NapkinCalc

Discrete Mathematics — Logic & Number Theory

Logic — true, false & combining them

ELI5: statements are either true or false, and we combine them with and (both must hold) and or (at least one). The engine evaluates these directly — a green check means the whole statement is true.

✓ pass (2>1)and(3>2)(2 > 1) and (3 > 2) AND: both halves are true
✓ pass (2>5)or(10>4)(2 > 5) or (10 > 4) OR: only one half needs to be true

Implication "if P then Q" is the backbone of every proof and every if statement in code. It only fails when P is true but Q is false.

prain=1p_{rain} = 1 1 = true: it is raining
✓ pass (prain==1)and(prain2==2)(p_{rain} == 1) and (p_{rain} * 2 == 2) a concrete true-and-true combination

Real-world hook: AND/OR/NOT are the logic gates etched into every processor, the filters in a database query, and the conditions in every program.