On this concept: Formula

Not sure which lesson to do first? Find your level and get a plan →

Math · Sets & Logic · Grade 9-12

Truth Table

A truth table lists every combination of true/false for the input variables and computes the expression's value in each row.

n variables ⇒ 2n rows in the truth table

Quick Answer

A truth table lists every combination of true/false for the input variables and computes the expression's value in each row. Use one to evaluate a compound statement in every possible situation, to test whether two expressions are logically equivalent, or to find exactly the cases that make a statement false. With n basic statements there are 2n rows: 4 rows for two statements, 8 for three. Fill the input columns in a fixed pattern, then compute the expression one connective at a time.

Why This Matters

A truth table replaces 'it seems to work' with a check of every case, so it settles questions that intuition gets wrong, such as whether P→Q is equivalent to Q→P (it is not). The same tables define the logic gates in every computer chip. Without a full table, a student who checks two or three favourable rows can 'prove' an equivalence that a missing row breaks.

Intuitive Explanation

A compound statement like 'it is sunny or it is not warm' depends on two basic facts. Each is T or F, so there are 2×2=4 possible situations, and a truth table gives each its own row. List them in a fixed pattern so none is missed or repeated: the first column reads T, T, F, F and the second T, F, T, F. With three statements, the first column has four T's then four F's, the second alternates in pairs, and the third alternates every row, giving 23=8 rows.

Then compute the expression from the inside out, one connective per column. For P∨¬Q: first a column for ¬Q (F, T, F, T), then the 'or' column (T, T, F, T). The only false row is P = F, Q = T, so the statement fails only when it is not sunny but it is warm. Two expressions are equivalent exactly when their final columns match in every row.

Checking one situation is not a truth table. When P and Q are both true, P∨Q and P∧Q are both true, which might suggest they are equivalent; the TF row shows they are not. A tree diagram also branches on T or F, and a Venn diagram shades regions, but only the full table puts every combination of inputs and its result side by side.

Think of it like this. A truth table is like testing a new light circuit by flipping its switches through every on/off combination and writing down whether the bulb lights. With 2 switches there are 4 settings to try, and each extra switch doubles the list. The one setting you skip could be the one that blows the fuse.

Core idea. A truth table enumerates all input truth assignments and the resulting value of an expression.


When to Use

Use a truth table when you must be sure about every case: proving that two statements are equivalent, checking whether an argument is valid, or finding exactly when a compound statement is false. It works best with two or three basic statements (4 or 8 rows). With many variables the table explodes (210=1024 rows), so use algebraic laws such as De Morgan's instead. For overlapping sets rather than statements, use a Venn diagram.

Tip. Ask: Am I listing every possible T/F combination of the inputs and the output for each?

How to Recognize It

Before building a table, count the basic statements involved and decide what the finished table has to show: one value, an equivalence, or the rows that fail.

  1. Are the inputs true-or-false statements, rather than overlapping groups of objects?

    If yes, a truth table fits. If no, as with students who play soccer and chess, a Venn diagram shows the regions more clearly; the two tools match, since each row corresponds to one region.

  2. Does the question involve only two or three basic statements?

    If yes, 4 or 8 rows are quick to list. If no, 2n grows fast, to 32 rows for five letters, so simplify first with laws such as De Morgan's, or hunt directly for one row that fails.

  3. Do you need the value in one specific situation only, such as P true and Q false?

    If yes, evaluate that single case; a full table is more than you need. If no, and the claim is about every possible case, such as an equivalence, build all the rows.

  4. Are you comparing two expressions to see whether they always agree?

    If yes, give each one its own column and compare them row by row; a single mismatched row means they are not equivalent. If no, one output column for your expression is enough.

Truth Table compared with Venn diagram, Single-case evaluation, and Tree diagram

Truth tables, Venn diagrams, single-case checks and tree diagrams all list cases. Ask what each row or branch stands for: one true-false assignment (truth table), a region of overlapping sets (Venn), one chosen case (single check), or a stage of a process (tree).

Truth Table

Meaning
Use this when you must check a logical expression across every possible combination of input truth values.
Key test
Am I listing every possible T/F combination of the inputs and the output for each?
Formula
n variables ⇒ 2n rows in the truth table
Example
How many rows are needed for a truth table of P∧Q, and in how many is it true?

Venn diagram

Meaning
Pictures set regions, not propositional rows.
Key test
Use for overlapping sets, not connectives.
Example
circles for A∩B

Single-case evaluation

Meaning
Checks one assignment, not all.
Key test
Use when only one specific input matters.
Example
evaluate P∧Q at P=T,Q=F

Tree diagram

Meaning
Maps sequential outcomes, not exhaustive truth assignments.
Key test
Use for staged events, not logic verification.
Example
branches for flips

Formula & Notation

n variables ⇒ 2n rows in the truth table
n propositional variables yield a truth table with 2n rows; a compound proposition is a function f:{⊤,⊥}n→{⊤,⊥}

How to read it: Rows list all combinations of T/F for input variables; the final column gives the output truth value

Worked Examples

Example 1 — Build a small table

Easy

How many rows are needed for a truth table of P∧Q, and in how many is it true?
Show the steps and the answer
  1. Count the rows: two statements give 22=4.

    Each of P and Q is T or F independently, so the choices multiply.

  2. List the inputs in a fixed pattern: TT, TF, FT, FF.

    A set pattern guarantees that no row is missed or repeated.

  3. Evaluate P∧Q in each row: T, F, F, F.

    'And' needs both parts true, which happens only in the first row.

  4. Count the true rows: 1.

    The final column contains a single T.

Answer: 4 rows, true in exactly 1

Takeaway: Two statements give 4 rows, and P∧Q is true in only one of them.

Example 2 — One row is not enough

Standard

Someone checks P=T,Q=T, sees P∨Q and P∧Q both true, and concludes they are equivalent. Right?
Show the steps and the answer
  1. Note what was checked: only the row P = T, Q = T.

    Equivalence means matching in all 4 rows, not in one.

  2. Fill the TF row: P∨Q=T but P∧Q=F.

    A single mismatch already shows the two are not equivalent.

  3. Fill the rest: FT gives T and F again; FF gives F and F.

    The full columns are T, T, T, F for 'or' and T, F, F, F for 'and'.

  4. Compare the columns: they differ in two rows.

    Different final columns mean the statements are not equivalent.

Answer: No — they differ in the TF and FT rows

Takeaway: Agreement in one row proves nothing; equivalent statements must have identical final columns.

Example 3 — Find the mistake: a table with missing rows

Application

Is ¬(P∧Q) equivalent to ¬P∧¬Q? Ben builds a table with only the rows TT and FF and writes: "In both rows the columns match (F and F, then T and T), so they are equivalent." Find the mistake and correct it.
Show the steps and the answer
  1. Count the rows needed: 22=4, but Ben used 2.

    The missing rows, TF and FT, are exactly where the expressions might differ.

  2. Fill row TF: ¬(T∧F)=¬F=T, while ¬T∧¬F=F∧T=F.

    The columns disagree, so the expressions are not equivalent.

  3. Fill row FT: ¬(F∧T)=T, while ¬F∧¬T=T∧F=F.

    A second mismatch confirms it.

  4. Find the correct partner: ¬P∨¬Q gives F, T, T, T, matching ¬(P∧Q) in all four rows.

    That is De Morgan's law: the negation of an 'and' is the 'or' of the negations.

Answer: Not equivalent: they differ in rows TF and FT. The correct law is ¬(P∧Q)⇔¬P∨¬Q.

Takeaway: A truth table proves equivalence only when all 2n rows match; the rows you skip are often the ones that disagree.

Where You'll See It

  • Logic gates in a chip

    Every computer chip is built from gates, each defined by a truth table. An AND gate with inputs 1 and 0 outputs 0; an XOR gate outputs 1 exactly when its inputs differ. Engineers test a circuit by running all 2n input patterns, so a 4-input circuit needs 16 test cases.

  • Staircase light switches

    A staircase light controlled from top and bottom can be wired from a truth table. In one common wiring, the settings up-up, up-down, down-up and down-down give ON, OFF, OFF, ON: the light is on exactly when the switches match. Flipping either switch changes whether they match, so it always changes the light.

Common Mistakes

  1. The slip: Listing fewer than 2n rows

    Instead: every combination of the n inputs must appear exactly once.

  2. The slip: Confirming an equivalence from a few favorable rows

    Instead: you must check all rows for a counterexample.

  3. The slip: Mis-ordering or repeating input combinations

    Instead: use a systematic count so no case is missed or doubled.


Mini Practice

Try these on your own. Tap Reveal when you want to check.

  1. How many rows does a truth table with 3 variables P, Q, R need? With 5 variables?

    Hint: Each new variable doubles the number of rows.

  2. Make the 4-row truth table for P∨¬Q. In how many of the rows is it false?

    Hint: List every pair of values for P and Q, then find ¬Q in each row.

  3. Use a truth table to decide whether ¬(P∧Q) and ¬P∨¬Q are equivalent.

    Hint: Fill in both columns for all 4 rows and compare.

  4. In how many of the 8 rows of the truth table for (P∧Q)→R is the statement false?

    Hint: When does a conditional fail? When is P∧Q true?

  5. You only want to know whether P→Q is true when P is false and Q is true. Do you need a full truth table or a single-case evaluation?

    Hint: How many rows does your question ask about?

  6. Kai checks P→Q and Q→P only in the rows P=T,Q=T and P=F,Q=F, finds they agree, and calls them equivalent. Correct Kai.

    Hint: How many rows does a 2-variable table have? Check the ones he skipped.

Want the full set?

50 practice questions for this concept — free to try, every one with a complete worked solution showing the why, not just the answer.

Frequently Asked Questions

Is there a standard order for the rows?

Most books use one: for two letters, TT, TF, FT, FF. In the first column the top half is T and the bottom half F, each later column switches twice as often, and the last column alternates T, F, T, F. It is like counting in binary with T as 0 and F as 1. Any order is correct if every row appears once, but the standard one makes tables easy to compare.

What does it mean if the last column is all T?

The expression is a tautology, true in every possible situation, like P∨¬PP \vee \neg P. If the column is all F, it is a contradiction, false in every situation, like P∧¬PP \wedge \neg P. Anything in between is called contingent. Valid arguments match tautologies: an argument is valid exactly when 'premises →\to conclusion' gets T in every row.

Who invented truth tables?

Truth tables in their modern form are usually credited to Ludwig Wittgenstein, whose Tractatus appeared in 1921, and to Emil Post, who published the same idea independently that year. Earlier logicians such as George Boole worked with true and false algebraically, and Charles Sanders Peirce sketched a table in 1893 in manuscripts that stayed unpublished for decades.

How do truth tables connect to computer circuits?

A logic gate is a tiny circuit whose output follows a truth table, with 1 for true and 0 for false. An AND gate outputs 1 only when both inputs are 1, and an OR gate when at least one is. Engineers write down the truth table they want, for example for adding two binary digits, then build it from gates: a half adder's sum column is exclusive or, and its carry column is AND.

Learning Path

← Before

Logical Statement
Truth Table

You are here

Next →

Nothing after this yet
You need Logical Statement, plus the connectives built on it: negation, 'and', 'or' and 'if-then'. The truth table adds a systematic way to evaluate any combination of them in all 2n cases. With it you can verify De Morgan's laws, show that a conditional matches its contrapositive, test whether an argument is valid, and design logic circuits.

See Also