Truth Tables

What is a Truth Table?

A truth table is a systematic way to figure out when a statement is true or false.

It lists every possible combination of truth values, and shows what the whole statement evaluates to.


Why Do We Need Them?

With simple statements like pqp \land q, you can reason it out in your head.

But what about something like this?

¬(pq)r\neg(p \land q) \lor r

When is this true? When is it false?

A truth table answers this systematically - no guessing required.


How Many Rows?

Each variable can be true or false (2 options).

So with nn variables, you need 2n2^n rows to cover every case.

VariablesRows needed
1 (just pp)21=22^1 = 2
2 (pp and qq)22=42^2 = 4
3 (pp, qq, rr)23=82^3 = 8
4 variables24=162^4 = 16

Pattern: Every new variable doubles the number of rows.


Building a Truth Table

Let’s work through an example step by step.

Statement: ¬pq\neg p \lor q

“NOT p, OR q”


Step 1: List All Combinations

We have 2 variables, so we need 22=42^2 = 4 rows.

ppqq
TT
TF
FT
FF

How to Fill the Columns

There’s a shortcut. Start from the rightmost column and work left.

  • Rightmost column: alternate every row (T, F, T, F…)
  • Each column to the left: double the block size

That’s it. The pattern is: 1, 2, 4, 8, 16…

Start with blocks of 1, then double each time you move left.


Step 2: Evaluate Intermediate Steps

Before we can compute ¬pq\neg p \lor q, we need to know ¬p\neg p.

ppqq¬p\neg p
TTF
TFF
FTT
FFT

Just flip each value of pp.


Step 3: Evaluate the Final Expression

Now compute ¬pq\neg p \lor q.

Remember: OR is true when at least one is true.

ppqq¬p\neg p¬pq\neg p \lor q
TTFT
TFFF
FTTT
FFTT

Step 4: Read the Result

Look at the final column. ¬pq\neg p \lor q is:

  • True in 3 cases (rows 1, 3, 4)
  • False in only 1 case (row 2)

When does it fail? Only when pp is true AND qq is false.


A More Complex Example

Statement: (pq)r(p \land q) \to r

“If (p AND q), then r”

We have 3 variables, so we need 23=82^3 = 8 rows.

ppqqrrpqp \land q(pq)r(p \land q) \to r
TTTTT
TTFTF
TFTFT
TFFFT
FTTFT
FTFFT
FFTFT
FFFFT

Reading This Table

The statement (pq)r(p \land q) \to r is:

  • True in 7 out of 8 cases
  • False in only 1 case

When does it fail? Only when pp AND qq are both true, but rr is false.

In plain English: “If both conditions are met, then the result must follow.”


The Process

To build any truth table:

  1. Count variables \to you need 2n2^n rows
  2. List all combinations of T/F for each variable
  3. Work inside out - evaluate parentheses first
  4. Add columns for each intermediate step
  5. Final column is your answer

Key insight: Truth tables are mechanical. Follow the steps, and you’ll always get the right answer.


Common Patterns to Recognize

After building enough truth tables, you’ll notice patterns:

Final columnWhat it means
All T’sTautology - always true, no matter what
All F’sContradiction - always false, no matter what
Mix of T’s and F’sContingent - depends on the inputs

Summary

  • Truth tables list every possible case
  • With nn variables, you need 2n2^n rows
  • Work inside out (parentheses first)
  • The final column tells you when the statement is true or false

Truth tables are the brute force method of logic - slow but always works.