Category: Logic and Proof Level: 201
p → q is false only when p is true and q is false
A truth table lists every combination of true and false inputs and the value of a statement for each. The conditional p → q is false in just one row.
A truth table lists every possible input. NOT has one input p, so it has two rows, and it turns true into false and false into true.
¬ T = F, ¬ F = T
With two inputs p and q there are four rows. The statement p ∧ q is true in one row: the row where both inputs are true.
p ∧ q = T only for p = T, q = T
The statement p ∨ q is true in 3 of the four rows. It is false only when both inputs are false.
p ∨ q = F only for p = F, q = F
The statement p → q says: if p happens, then q happens. When it rains, the promise is kept with an umbrella and broken without one.
T → T = T, T → F = F
When it does not rain, nothing I do breaks the promise, so p → q is true in both rows where p is false. The conditional is false only in the row T, F.
F → T = T, F → F = T
Add a column for ¬p ∨ q. It matches p → q in every row, so the two statements say the same thing.
p → q ≡ ¬ p ∨ q
cd svg-generator python3 -m svgmath render truth-tables --out /tmp/truth-tables
Source: svgmath/diagrams/logic.py