Truth Tables

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.

Step through it

Watch it

Animated walkthrough

Step by step

Step 1: NOT flips a statement

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

Step 1: NOT flips a statement

Step 2: AND needs both

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

Step 2: AND needs both

Step 3: OR needs at least one

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

Step 3: OR needs at least one

Step 4: Read the conditional as a promise

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

Step 4: Read the conditional as a promise

Step 5: Explain the surprising rows

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

Step 5: Explain the surprising rows

Step 6: Rewrite the conditional

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

Step 6: Rewrite the conditional

All steps at once

Storyboard

Generate it yourself

cd svg-generator
python3 -m svgmath render truth-tables --out /tmp/truth-tables

Source: svgmath/diagrams/logic.py