The number of rows is 2ⁿ
Each variable doubles the cases. Three variables give 8 rows, five give 32. This growth is why “Logical Equivalence”'s equivalence laws are worth having.
A truth table lists every assignment of truth values to the variables and evaluates the formula at each. It is finite, mechanical and complete — and it is the only tool in this course that can never be wrong.
Core ideas
Truth tables are the ground truth of propositional logic. Every later shortcut is justified by the fact that a table would agree.
Each variable doubles the cases. Three variables give 8 rows, five give 32. This growth is why “Logical Equivalence”'s equivalence laws are worth having.
Evaluate the innermost subexpressions first and build outward, exactly as you would evaluate an arithmetic expression.
If two formulas agree in every row they are equivalent, full stop. There is nothing further to check, because the rows are all the cases there are.
The material
Rows first, then columns, then read the answer off the last one.
A truth table for a formula with variables p₁ … pₙ has one row per assignment of truth values to those variables. Since each variable takes two values independently, there are 2ⁿ rows — a fact that is really the product rule of counting, which Combinatorics and Counting makes explicit.
The conventional row order lists T before F and varies the rightmost variable fastest, so with two variables the rows read TT, TF, FT, FF. Any order works; a consistent one lets two tables be compared line by line.
A table with one row per assignment of truth values to the variables of a formula, and one column per subexpression, ending with the value of the whole formula in that assignment.
The intermediate columns are not decoration. They are where a mistake is caught: if the final column looks wrong, the subexpression columns tell you exactly which step produced it.
First a column for p ∧ q (true in one row of four), then negate it (true in three). Compare with the column for ¬p ∨ ¬q: same four values. That agreement is De Morgan's law, and the table is its proof.
Any question about a formula built from ¬ ∧ ∨ → ↔ ⊕ — is it always true, is it ever true, is it equivalent to this other one — is answered by its truth table. There is no propositional question a table leaves open.
The catch is size, not correctness. Ten variables give 1024 rows and twenty give over a million; deciding whether a large formula is satisfiable is the canonical hard problem of computer science, and Algorithms and Complexity returns to it by name.
Interactive
Every assignment, evaluated
Method
Five minutes of setup saves the errors that come from improvising.
Three variables means eight rows. Getting this wrong at the start guarantees a wrong answer at the end.
Rightmost alternates every row, next every two rows, next every four. The pattern makes a missing row visible.
Innermost first. Each new column should depend only on columns already written.
All T is a tautology, all F a contradiction, a mixture is contingent — the vocabulary of “Tautology, Contradiction, Satisfiability”.
Three variables, so eight rows, and two subexpression columns: ¬p and q ∧ r, then the disjunction of the two.
Read the shape of the last column. When p is false, ¬p is true and the disjunction is true whatever q and r do — four rows settled by one column. When p is true everything rests on q ∧ r, and only the row where both hold survives. Keep this column: “The Conditional and Its Relatives” introduces a connective, →, whose table is exactly this one, and the rows that surprise people there are the four you have just filled in without surprise.
Take (p ∨ q) ∧ ¬(q ∧ r) and produce all eight rows with p ∨ q, q ∧ r and ¬(q ∧ r) as separate columns. If the row pattern is automatic, the rest of this course is bookkeeping.
Something to change about this lesson? Write it down, tick it off when it is handled, and export the list when you want to act on it. Kept in this browser only: nothing is sent anywhere, and nobody is notified.
No recommendations yet for this lesson.