Skip to main content

Subsection 2.3.1 Building Truth Tables for More Complex Logical Expressions

If this were arithmetic, instead of logic, we would now know how to add, subtract, multiply, divide, and change the sign of a number. But we want to do more complex things (like adding three numbers). Similarly for logical expressions. We want to be able to combine multiple operators to form a single meaningful expression. To do this, we must be able to build more complex truth tables.

Let’s start with a two-operator expression:

\(( p \wedge q ) \vee p \)

We want to build a truth table whose final column tells us the truth value of that expression given any set of truth values that may occur for the individual variables \(p\) and \(q\text{.}\)

To see how to compute that column, we return to our analogy with arithmetic: If we wanted to evaluate \((1+2)×3 \) , we would start with the innermost expression and evaluate outward. So, in this arithmetic case, we’d start with \((1+2) \text{.}\) For our logic example, we’ll start with \((p \wedge q )\text{.}\) We will introduce “working columns” that specify the truth values for all the intermediate expressions. We’ll be able to compute the final column by combining the working columns.

With one working column, our truth table looks just like the table for and:

p q pq
T T T
T F F
F T F
F F F

Now we need to add a new column for (pq) ∨ p:

p q pq (pq) ∨ p
T T T
T F F
F T F
F F F

The third column has the truth values that we just computed for pq. The first column still has the truth values for p. We need to or those two columns together to create the values for the new fourth column. We’ll highlight the columns that we’re working with in red.

Starting with the first row, we see that pq is T and p is T. The truth table for the or operator tells us that T \(\wedge \)T is T, so the first entry in the fourth column should be T:

p q pq (pq) ∨ p
T T T T
T F F
F T F
F F F

In the second row, we see that pq is F and p is T. The truth table for the or operator tells us that F \(\wedge \)Tis T, so the second entry in the fourth column should be T:

p q pq (pq) ∨ p
T T T T
T F F T
F T F
F F F

In the third row, we must compute F \(\wedge \)F, which is F. And for the last row, we must do the same thing. So the complete truth table for the expression (pq) ∨ p is

p q pq (pq) ∨ p
T T T T
T F F T
F T F F
F F F F