Sheet 05 of 22
Truth tables
Needs sheet 04 for the connectives.
A truth table lists every way the atomic statements could be true or false, then works out the formula for each. It is a finite, complete survey of the possible situations, and it turns the imagination work of sheet 02 into arithmetic.
05.1 The five definitions
The connectives are defined by their tables. These are the definitions, and the conditional has its own page, sheet 06, because its table is the one people dispute.
| P | ¬P |
|---|---|
| T | F |
| F | T |
| P | Q | P ∧ Q | P ∨ Q | P → Q | P ↔ Q |
|---|---|---|---|---|---|
| T | T | T | T | T | T |
| T | F | F | T | F | F |
| F | T | F | T | T | F |
| F | F | F | F | T | T |
With n atomic letters there are 2ⁿ rows, since each letter doubles the count. This site lists rows the common way: T before F, with the rightmost letter changing fastest. Any order works so long as no row goes missing.
05.2 Building one
Work from the inside outward, giving each subformula a column. Here is ¬(P ∧ Q), one step at a time.
| P | Q | P ∧ Q | ¬(P ∧ Q) |
|---|---|---|---|
| T | T | T | F |
| T | F | F | T |
| F | T | F | T |
| F | F | F | T |
For anything longer, write the steps down. The tool has a “show every step” option for this reason. The answer matters less than the habit of knowing which part you are computing.
05.3 Three kinds of formula
Definition
Tautology. A formula true in every row. Also called logically true.
Definition
Contradiction. A formula false in every row.
Definition
Contingent formula. A formula true in some rows and false in others.
Example
P ∨ ¬P is a tautology, and P ∧ ¬P is a contradiction. A tautology gives no information about the world, because it rules no possibility out. “Either it will rain tomorrow or it will not” cannot be wrong, and it is no use for planning a picnic.
| P | P ∨ ¬P | P ∧ ¬P |
|---|---|---|
| T | T | F |
| F | T | F |
Counterexample
People say “that’s a tautology” about a sentence like “boys will be boys”. As a piece of logic, B → B would be a tautology, but the speaker means something contingent and quite substantive about how boys behave. A sentence’s look is no guide to its logical form.
05.4 Equivalence
Definition
Logically equivalent. Two formulas are equivalent when they have the same truth value in every row.
Equivalent formulas say the same thing, as far as truth goes, and may replace each other anywhere. The most useful pair of equivalences are named after the nineteenth-century logician Augustus De Morgan.
| P | Q | ¬(P ∧ Q) | ¬P ∨ ¬Q |
|---|---|---|---|
| T | T | F | F |
| T | F | T | T |
| F | T | T | T |
| F | F | T | T |
| P | Q | ¬(P ∨ Q) | ¬P ∧ ¬Q |
|---|---|---|---|
| T | T | F | F |
| T | F | F | F |
| F | T | F | F |
| F | F | T | T |
Read in English: to deny a conjunction is to assert that at least one part fails. To deny a disjunction is to assert that both fail. Programmers use these daily, as sheet 22 shows, and they are behind the “not both” and “neither” rows on sheet 04.
Here is a pair that looks equivalent and is not.
| P | Q | P → Q | Q → P |
|---|---|---|---|
| T | T | T | T |
| T | F | F | T |
| F | T | T | F |
| F | F | T | T |
05.5 Testing an argument
Now the payoff. Put each premise and the conclusion in its own column. Hunt for a row where all the premises are true and the conclusion is false. Such a row is a possible situation that breaks the argument, which is what sheet 02 said a counterexample must be. No such row means the argument is valid. The survey covers every case, so nothing has been overlooked.
| P | Q | R | P → Q | Q → R | P → R | Note |
|---|---|---|---|---|---|---|
| T | T | T | T | T | T | |
| T | T | F | T | F | F | |
| T | F | T | F | T | T | |
| T | F | F | F | T | F | |
| F | T | T | T | T | T | |
| F | T | F | T | F | T | |
| F | F | T | T | T | T | |
| F | F | F | T | T | T |
Valid: no row has every premise true and the conclusion false. Open in the truth-table tool
| P | Q | P ∨ Q | P | ¬Q | Note |
|---|---|---|---|---|---|
| T | T | T | T | F | counterexample |
| T | F | T | T | T | |
| F | T | T | F | F | |
| F | F | F | F | T |
Invalid: one row has every premise true and the conclusion false. Open in the truth-table tool
The second is invalid under inclusive or: the row where both are true has the premises true and the conclusion false. A shaded row is more than a verdict. It tells you exactly what the counterexample is. Here it reads: let P and Q both be true.
There is a tidy connection between these ideas, and it is worth noting once:
Rule
An argument with premises A, B and conclusion C is valid exactly when the single formula (A ∧ B) → C is a tautology. Checking validity and checking for tautology are one job in two outfits.
05.6 The short way
Sixteen rows are tedious and sixty-four are worse. Often you can work backwards. To test (P → Q) → (¬Q → ¬P), suppose it is false and try to make that work. A conditional is false only with a true antecedent and a false consequent, so P → Q is true and ¬Q → ¬P is false. That second fact needs ¬Q true and ¬P false, so Q is false and P is true. But then P → Q is false, against what we required. The supposition collapses, so the formula cannot be false: it is a tautology. That is the same reasoning as a full table, skipping the rows that could not matter.
05.7 Where the method stops
Tables work for all of propositional logic. That is a strong result: the subject is decidable, meaning a fixed procedure always gives a right answer. There are two limits.
First, size. Thirty letters give over a billion rows, and the count doubles with every letter added. Whether something fundamentally faster exists is a famous open question, tied to the P versus NP problem that sheet 22 mentions.
Second, expressive power. Tables cannot see inside atomic statements, and this argument defeats them:
- All humans are mortal.
- Socrates is a human.
Therefore: Socrates is mortal.
In propositional terms that is A, B, so C: three unrelated letters. A table finds a counterexample, and the counterexample is an artefact of a poor translation. The validity depends on the internal structure of those sentences, which is why sheet 10 exists. So a table’s “valid” can be trusted absolutely. Its “invalid” means only “invalid as far as propositional form goes”.
The method itself came together slowly. Emil Post and Ludwig Wittgenstein both published it in 1921, and earlier traces exist in the work of Charles Sanders Peirce.
Try to break this
Find a formula with three letters that is true in exactly one row. Now one that is true in exactly seven. Can you find a recipe that produces a formula for any pattern of T and F you care to write in the last column? (There is one. It is the reason a computer can be built out of a few kinds of gate. See sheet 22.)
05.8 Exercises
How many rows does a table for
(P ∧ Q) → (R ∨ S)need? Is the formula a tautology?Answer
Four letters, so 16 rows. It is not a tautology: let
PandQbe true andRandSbe false. Then the antecedent is true and the consequent false.Classify
(P → Q) ∨ (Q → P), and say whether that surprises you.Answer
It is a tautology. If
Qis true the first disjunct is true, and ifQis false the second is. It surprises most people, since it says that of any two statements at all, one implies the other. sheet 06 explains why the conditional allows this.Are
P → (Q → R)and(P ∧ Q) → Requivalent?Answer
Yes. Each is false in exactly one row:
PandQtrue andRfalse. The equivalence is called exportation.Are
P → (Q → R)and(P → Q) → Requivalent?Answer
No. Let
P,QandRall be false. The first is true, since its antecedent is false. The second has antecedentP → Q, which is true, and consequentR, which is false, so it is false. Bracket placement matters.Use a table, or the tool, to test:
P → Q,¬Q → R, soP → R.Answer
Invalid. Take
Ptrue,Qtrue,Rfalse. ThenP → Qis true, and¬Q → Ris true because¬Qis false, whileP → Ris false.Use the short way to show that
P ∧ ¬P → Qis a tautology.Answer
Suppose it is false. Then the antecedent
P ∧ ¬Pmust be true, which needsPand¬Pboth true. That cannot be, so the formula cannot be false.