Truth Tables
Learning objectives
- Construct truth tables for compound propositions
- Determine the number of rows in a truth table from the variable count
- Classify statements as tautologies, contradictions, or contingencies
- Test logical equivalence by comparing two truth columns row by row
Why bother building a table of true/false rows when most arguments only need one example? Because logic compounds: once , , , , are all in play, the rules tangle fast. A truth table is the brute-force ground truth: list every possible world, evaluate the formula in each, and compare. If two formulas agree in every row, they are interchangeable forever. If a formula is true in every row, it is a theorem of pure logic. Truth tables are how mathematicians and computer scientists certify their logical equipment is sound before they trust it on real proofs.
The mechanical idea
A truth table lists every assignment of truth values to the propositional variables and computes the truth value of the compound formula in each row. If the formula has variables, the table has exactly rows — each variable is either or , independently of the others.
For two variables and the table has rows. The basic connectives (AND), (OR), (NOT), (implies), and (iff) each have a fixed rule for combining truth values. The widget below lets you toggle and or type your own formula and watch the column appear in real time.
Tautology, contradiction, contingency
The shape of a formula's truth column tells you what kind of statement it is:
- A tautology has a column of all . The classic example is , the law of excluded middle: no matter what is, the formula is true.
- A contradiction has a column of all . The classic example is : a statement cannot be both true and false at once.
- A contingency has both and rows — the formula's truth depends on the world. Most everyday statements are contingencies.
Logical equivalence
Two formulas are logically equivalent — written — when they agree in every row of their joint truth table. Equivalent formulas are interchangeable in any proof: each one means exactly the same thing.
The two cornerstone equivalences of elementary logic are De Morgan's laws:
Read aloud: "not (P and Q)" is the same as "not P or not Q." When you negate an AND statement, the negation distributes across the conjuncts and the connective flips. The same move works for OR — negation turns OR into AND. Both laws collapse to a single mental rule: push the negation through, flip the connective.
Another foundational equivalence connects implication to disjunction: . This one is worth knowing by heart because it lets you rewrite any conditional as a simple OR — the bridge between the language of implication and the language of disjunction.
Pause and think: Why is logically equivalent to ? Trace each of the four (P, Q) rows in your head before you continue. (Hint: the only failing row for implication is , — the only row where is also false.)
Try it
- Before opening the widget: how many rows does the truth table for have? Type the formula in the custom-expression box and count.
- Predict first: is a tautology, a contradiction, or a contingency? Verify with the widget.
- De Morgan check: predict the column of for each of the four (P, Q) assignments. Now toggle the inputs through all four and see if your prediction matches.
- Equivalence drill: are and logically equivalent? Build both columns and compare row by row.
A trap to watch for
Beginners often read as "if then " and instinctively make the conditional false whenever is false. That is wrong. The conditional is true whenever is false, no matter what says. The truth table is: , , , . The only way an implication can fail is if the antecedent is true but the consequent is false. Conditionals with a false antecedent are vacuously true — they make no claim about reality, so by default they are true. This is initially uncomfortable, but it is the only definition that makes the rest of logic (modus ponens, contrapositive, chained reasoning) hang together.
What you now know
You can take any compound propositional formula, enumerate the rows of its truth table, and read off whether it is a tautology, contradiction, or contingency. You can also test whether any two formulas are logically equivalent — the gold-standard equivalence test in propositional logic. In the next section, conditionals and biconditionals, you will use these tables to verify the law of contrapositive and prove that some seemingly different statements are actually the same.
References
- Velleman, D. J. (2019). How to Prove It: A Structured Approach (3rd ed.). Cambridge University Press, ch. 1.
- Enderton, H. B. (2001). A Mathematical Introduction to Logic (2nd ed.). Academic Press, §1.2.
- Smullyan, R. M. (1995). First-Order Logic. Dover Publications, ch. 1.
- Biere, A., Heule, M., van Maaren, H., Walsh, T. (eds.) (2009). Handbook of Satisfiability. IOS Press, ch. 1.
- Knuth, D. E. (2015). The Art of Computer Programming, Vol. 4A: Combinatorial Algorithms, Part 1. Addison-Wesley, §7.1.1.