Truth Tables: Computing Logical Values
A truth table is a machine that computes logic.
You feed it a logical expression. It systematically checks every possible combination of truth values. It tells you exactly when the expression is true and when it's false.
No intuition required. No ambiguity possible. Pure mechanical computation.
This is the power of formalization: questions about validity become algorithmic. "Is this argument valid?" becomes "Does this truth table have the right pattern?" Anyone can check the answer.
Building a Truth Table
For P ∧ Q (P and Q):
Step 1: List all combinations of input values. With 2 variables, there are 2² = 4 combinations.
| P | Q |
|---|---|
| T | T |
| T | F |
| F | T |
| F | F |
Step 2: Compute the output for each row. P ∧ Q is true only when both P and Q are true.
| P | Q | P ∧ Q |
|---|---|---|
| T | T | T |
| T | F | F |
| F | T | F |
| F | F | F |
Done. The table completely describes the conjunction.
Multi-Column Tables
For complex expressions, work inside-out.
(P → Q) ∧ (Q → P):
| P | Q | P → Q | Q → P | (P → Q) ∧ (Q → P) |
|---|---|---|---|---|
| T | T | T | T | T |
| T | F | F | T | F |
| F | T | T | F | F |
| F | F | T | T | T |
The final column shows: this expression is true exactly when P and Q have the same truth value. It's equivalent to P ↔ Q.
Three Special Patterns
Tautology: True in every row.
P ∨ ¬P:
| P | ¬P | P ∨ ¬P |
|---|---|---|
| T | F | T |
| F | T | T |
All T's. This is a logical truth — it must be true regardless of what P means.
Contradiction: False in every row.
P ∧ ¬P:
| P | ¬P | P ∧ ¬P |
|---|---|---|
| T | F | F |
| F | T | F |
All F's. This is logically impossible.
Contingent: True in some rows, false in others.
P → Q is contingent — its truth depends on the values of P and Q.
Testing Validity
An argument is valid if: whenever all premises are true, the conclusion is true.
Argument: P → Q, P, therefore Q.
Build a truth table with columns for all premises and the conclusion:
| P | Q | P → Q | P | Q |
|---|---|---|---|---|
| T | T | T | T | T |
| T | F | F | T | F |
| F | T | T | F | T |
| F | F | T | F | F |
Look for rows where ALL premises are true (columns P → Q and P both T). That's only the first row. In that row, is the conclusion (Q) true? Yes.
The argument is valid. This is modus ponens.
Testing Invalidity
Argument: P → Q, Q, therefore P.
| P | Q | P → Q | Q | P |
|---|---|---|---|---|
| T | T | T | T | T |
| T | F | F | F | T |
| F | T | T | T | F |
| F | F | T | F | F |
Rows where all premises are true: rows 1 and 3 (P → Q is T and Q is T). Row 1: conclusion P is T ✓ Row 3: conclusion P is F ✗
The argument is invalid. There's a row where premises are true but conclusion is false. This is the fallacy of affirming the consequent.
Testing Equivalence
Two expressions are logically equivalent if they have identical truth tables.
Are ¬(P ∧ Q) and ¬P ∨ ¬Q equivalent?
| P | Q | P ∧ Q | ¬(P ∧ Q) | ¬P | ¬Q | ¬P ∨ ¬Q |
|---|---|---|---|---|---|---|
| T | T | T | F | F | F | F |
| T | F | F | T | F | T | T |
| F | T | F | T | T | F | T |
| F | F | F | T | T | T | T |
Columns ¬(P ∧ Q) and ¬P ∨ ¬Q are identical. They're equivalent. This is De Morgan's Law.
Scaling Up
With n variables, you need 2^n rows:
| Variables | Rows |
|---|---|
| 1 | 2 |
| 2 | 4 |
| 3 | 8 |
| 4 | 16 |
| 5 | 32 |
| 10 | 1024 |
The method always works but gets tedious. For practical arguments with many variables, we use other techniques (proofs, semantic tableaux). But truth tables are the gold standard for definitive answers.
Systematic Row Generation
For consistent row ordering, use binary counting:
3 variables (P, Q, R):
| P | Q | R |
|---|---|---|
| T | T | T |
| T | T | F |
| T | F | T |
| T | F | F |
| F | T | T |
| F | T | F |
| F | F | T |
| F | F | F |
First column alternates in groups of 4. Second column alternates in groups of 2. Third column alternates every row.
This systematic approach ensures you never miss a combination.
The Power of Truth Tables
Truth tables convert logic from philosophy to engineering.
Is this argument valid? Build a table and check. Are these expressions equivalent? Build a table and compare. Is this a tautology? Build a table and see if all rows are T.
No interpretation. No intuition. No debate. Just computation.
This mechanization is what makes logic useful in computer science. Digital circuits are physical implementations of truth tables. Programming logic follows the same rules. The Boolean algebra of electronics is propositional logic in silicon.
Part 4 of the Logic series.
Previous: Logical Connectives: And Or Not If-Then Next: Logical Equivalence: Different Statements Same Meaning
Comments ()