Symbolic LogicTruth Tables

Building a Truth Table

A formula with n letters has 2ⁿ rows; list them in a fixed order and fill a column for each part, ending with the main connective.

Not started Jump to practice

In Computing a Truth Value you found a formula's value in one row. A truth table does that for every possible row at once, so you can see everything a formula can do.

Key idea

A formula with $n$ different letters needs $2^n$ rows. List them in the standard order: the first letter is T for the first half of the rows and F for the second half; each later letter halves the block size; the last letter alternates T, F. Then fill a column for each part, ending with the main connective.

Why it works

Each letter can be T or F independently. With one letter that gives 2 cases; adding a letter doubles the count, because each old case splits into one with the new letter T and one with it F. So 2 letters give 4 rows, 3 give 8, and 4 give 16. The standard order is simply a way to write all of them with no repeats and no gaps.
The standard order for three letters: blocks of 4, then 2, then 1.
$p$$q$$r$
TTT
TTF
TFT
TFF
FTT
FTF
FFT
FFF
Fill every column, then Check. The part columns lead to the main column.

Worked examples

Worked example: How many rows?

How many rows does the table for $(p \land q) \to (r \lor \neg p)$ need?
  1. Count the different letters: $p$, $q$, $r$. Repeats of $p$ do not count again.
  2. $2^3 = 8$.

Answer: 8 rows

Worked example: Build a small table

Make the table for $p \to \neg q$.
  1. Rows: TT, TF, FT, FF.
  2. Column $\neg q$: F, T, F, T.
  3. Column $p \to \neg q$: T→F is F; T→T is T; F→F is T; F→T is T.

Answer: F, T, T, T

Worked example: Read a value

In the standard order for $p$, $q$, $r$, what is $q$ in row 6?
  1. $q$ runs in blocks of 2: T T F F T T F F.
  2. Rows 5 and 6 make up the third block of two, and that block is T T.

Answer: T

Common mistake

Missing rows or repeating them, which happens when the rows are written in no fixed order. Use the halving pattern every time: for three letters, write $p$ as TTTTFFFF, $q$ as TTFFTTFF and $r$ as TFTFTFTF. Then count: the table must have exactly $2^n$ rows.
  • Count the letters and write $2^n$ rows in the standard order.
  • Add a column for each part, from the smallest outward.
  • Fill each column from the columns it depends on.
  • The last column, under the main connective, is the answer.

Truth tables can grow large, but they never fail: a table always answers the question it is asked. That is why the next topics use them to decide whether a formula is always true, whether two formulas agree, and whether an argument is valid.

Practice

Pass with 3 right answers, the last 2 in a row. Each right answer earns 2 XP.

Loading practice…

Builds on

Leads to

Sources and further reading

  • Patrick J. Hurley and Lori Watson, A Concise Introduction to Logic, 13th ed., section 6.3, Truth Tables for Propositions
  • forall x: Calgary, an open introduction to formal logic (P. D. Magnus, Tim Button and others; Open Logic Project), chapter on complete truth tables
@teddyrookbook GitHub