Chapter 4: Logic

Section 4.2: Introduction to Truth Tables

In the previous section, it was mentioned that a statement has a truth value. However, it wasn't really discussed what a truth value is. When it is a simple statement, the truth value is easy to declare. However, in compound statements, or even complex Boolean statements, it can get tricky to think about. In these situations, we need to create something known as a truth table to keep track of the truth value that makes up the individual simple statements that make up the complex statement, and tell us if the complex statement is true or false.

Basic Truth Tables

Conjunction — outcomes for \(A \wedge B\)
Truth table for conjunction (A and B)
A B A \( \wedge \) B
TTT
TFF
FTF
FFF
Table 4.2.1-Conjunction outcomes
Disjunction — outcomes for \(A \vee B\)
Truth table for disjunction (A or B)
A B A \( \vee \) B
TTT
TFT
FTT
FFF
Table 4.2.2-Disjunction outcomes
Conditional — outcomes for \(A \rightarrow B\)
Truth table for conditional (if A then B)
A B A \( \rightarrow \) B
TTT
TFF
FTT
FFT
Table 4.2.3-Conditional outcomes
Biconditional — outcomes for \(A \leftrightarrow B\)
Truth table for biconditional (A iff B)
A B A \( \leftrightarrow \) B
TTT
TFF
FTF
FFT
Table 4.2.4-Biconditional outcomes

Negation: A negation will change the truth value of the statement. That means if the statement was true, the negation would be false, and vice-versa.

Moving forward in this chapter we will continue to reflect back to the basic truth tables above, in order to help us answer complex statements. Think of these as the rules for each of the different combinations.

Example 1

Suppose you and your significant other are picking out a new couch and your significant other says to you, "I want to get a sectional or something with a chaise." Under what circumstances are they going to be happy with your selection?

Solution

First, let's look at what this statement would look like symbolically. If we allow p to represent "I want a sectional" and q be "I want a chaise", our complex statement symbolically would be p $\vee$ q. This is an example of a disjunction, meaning we need to look at the disjunction table:

Table 4.2.5 — Example 1 Truth Table
Truth table displaying columns p,q, and p or q and their truth values for each combination of True/False.
p q p $\vee$ q
T T T
T F T
F T T
F F F

Looking at the table, we can see that your significant other will be happy as long as you get both the sectional and the chaise, just the sectional, or just the chaise. But, if you do not purchase either, they will be upset.

Setting up Truth Tables

What if in the previous example our significant other said, "I want a sectional or not a chaise." This would change our entire symbolic statement to make it p $\vee\sim$ q. How would you find the different options of the truth value for that complex statement? The first thing we would need to do is set up the truth table with the first two columns for "p" and "q". When we start this table, we are trying to set up every possible combination that true or false may take on. We could think of this like a tree diagram if we wanted to before putting it into the table.

Tree diagram showing Statement 1 branching into True and False, each further branching for Statement 2 with true and false outcomes. Statement 1 Statement 2 True False True False True False
Figure 4.2.1 — Tree diagram of True/False outcomes for two statements.

Now we can start to construct the table:

Table 4.2.6 — Basic set up of True, False values in a tabular format for two statements.
Truth table displaying columns p,q, and their truth values for each combination of True/False.
p q
T T
T F
F T
F F

This is just the initial set-up. This is the same set-up we will use for all truth tables for compound statements that only contain two simple statements. Next, we need to look back at what the symbolic statement was and ask ourselves, "What do we need to build or construct our compound statement?" Our symbolic statement is p $\vee\sim$ q. To complete this statement, we are missing the $\sim$ q. That means we need to construct that statement next in our truth table. To do this, we will need to add a new column to get:

Table 4.2.7 — Constructing a Truth Table part 2.
Truth table displaying columns p,q,not q, and their truth values for each combination of True/False.
p q $\sim$ q
T T F
T F T
F T F
F F T

Notice that we get the values for the new column by simply negating the value in the q column. To finish up this truth table, we need to complete our truth table by finding p $\vee\sim$ q. To do this, we would use our tables in the Basic Truth Tables section to find the value between the columns p and $\sim$ q to find:

Table 4.2.8 — Constructing a Truth Table part 3.
Truth table displaying columns p,q,not q, and "p or not q" and their truth values for each combination of True/False.
p q $\sim$ q p$\vee\sim$ q
T T F T
T F T T
F T F F
F F T T

Looking at the table above, we can see that there is only one instance in which this statement is false. We allowed this statement to verbally represent, "I want a sectional or not a chaise." Looking at the outcome of the table, we can see that the only time our significant other will not be happy is the fourth row of the table, where we don't purchase the sectional but we purchase the chaise. Logically if you think about this, it makes sense because our significant other specifically said they did not want the chaise.

Example 2

Complete the truth table for the symbolic statement $(\text{q}\rightarrow\sim\text{p})\wedge q$.

Solution

Sometimes it's easiest to think about what this would be verbally. Let's allow p = "I have a cat" and q = "My cat is calico." This would make our compound statement $(\text{q}\rightarrow\sim\text{p})\wedge q$ = "If my cat is calico, then I don't have a cat, and it's calico." Let's set up our table. To start, we know what our first two columns will be. It's the same as the other problem. Next, look at our statement and identify the pieces we don't have to complete this. In this case, we are missing $\sim$ p. Adding that column to our initial table would give us:

Table 4.2.9 — Constructing a Truth Table Example 2.
Truth table displaying columns p,q,not q, and their truth values for each combination of True/False.
p q $\sim$ p
T T F
T F F
F T T
F F T

Now we work through our compound statement, as if we were following Order of Operations, or PEMDAS. Starting with our parenthesis, we need to construct the truth values for the statement q $\rightarrow\sim$ p. Once again, we will use our rules from the Basic Truth Tables section using the "conditional" table.

Table 4.2.10 — Constructing a Truth Table Example 2 step 2.
Truth table displaying columns p,q,not q, and "if q then not p, and q" and their truth values for each combination of True/False.
p q $\sim$ p q $\rightarrow\sim$ p (q $\rightarrow\sim$ p)$\wedge$ q
T T F F F
T F F T F
F T T T T
F F T T F

For this example, we can see that this statement is only true if p is false and q is true. Or using the context of the problem we made up, it's only true if you don't own a cat, and the cat is calico.

What if you needed to create a truth table that had a compound statement made up of three different simple statements? This means that it is no longer just p and q. What if we wanted to create a truth table for the following compound statement, "The sky is blue and it is not the case that the grass is green or the ocean is salty." First, allow us to symbolically identify this statement. Symbolically, this would be p$\wedge\sim$(q$\vee$r). Notice how we have a third statement. This will change our first couple columns considerably. Let's look back at that tree-diagram again.

Tree diagram showing Statements 1, 2, and 3 branching into true and false outcomes. Statement 1 Statement 2 Statement 3 True False True False True False True False True False True False True False
Figure 4.2.2 — Tree diagram of True/False outcomes for three statements.

We can see from looking at the tree diagram that it's really going to add to our rows in our truth table. Where in the previous examples, we used four rows not including the title row, now we will need eight rows, not including the title row. Thus if we set our table up, we would find:

Table 4.2.11 — Basic Truth Table Setup: Three Statements.
Truth table displaying columns p,q,and r with their truth values for each combination of True/False.
p q r
T T T
T T F
T F T
T F F
F T T
F T F
F F T
F F F

Next, we can move right into finishing up all the columns building out the title row to get:

Table 4.2.12 — Constructing a Truth Table three statements.
Truth table displaying columns p,q,r,q or r, not(q or r), p and not ( q or r), displaying the set up of the header column.
p q r q $\vee$ r $\sim$(q $\vee$ r) p$\wedge\sim$(q $\vee$ r)
T T T
T T F
T F T
T F F
F T T
F T F
F F T
F F F

Lastly, complete the table:

Table 4.2.13 — Truth Table Solution.
Truth table from table 4.2.12 displaying the true/false values and the solution highlighted in the 5th row down from the top.
p q r q $\vee$ r $\sim$(q $\vee$ r) p$\wedge\sim$(q $\vee$ r)
T T T T F F
T T F T F F
T F T T F F
T F F F T T
F T T T F F
F T F T F F
F F T T F F
F F F F T F

It turns out this complex expression is true for only one case, and that is when P is true, q is false, and r is false. The row in the table has been highlighted.

Example 3

Construct the truth table for the statement (m $\wedge\sim$ n)$\rightarrow$ p.

Solution

First, don't allow the difference in the letters to confuse you. We can use any letters we want to signify statements. Typically, in symbolic logic, the letters "p", "q", and "r" are used, but they don't have to be. But, since this compound statement contains three variables, we need eight rows in our table past our title row. Then we can concentrate on what we need to construct the (m $\wedge\sim$ n), which is $\sim$ n, and then we can construct that statement. The series of tables below show that progression:

Step 1 - Initial Truth Table

Table 4.2.14 — Intitial Truth Table Example 3.
Initial Truth table showing statements m,n, and p and their corresponding truth value combinations.
m n p
T T T
T T F
T F T
T F F
F T T
F T F
F F T
F F F

Step 2 - Add column $\sim n$

Table 4.2.15 — Constructing a Truth Table Add Column $\sim$ n.
Continuing the work from the previous table displaying the next column to be added which is not n.
m n p $\sim$n
T T T F
T T F F
T F T T
T F F T
F T T F
F T F F
F F T T
F F F T

Step 3 - Add Column $m \wedge \sim n$

Table 4.2.16 — Constructing a Truth Table adding the next column of m$\wedge\sim$ n.
Continuing the construction of the truth table moving on to the next column with m and not n, along with its correspoding truth values.
m n p $\sim$n $m \wedge \sim n$
T T T F F
T T F F F
T F T T T
T F F T T
F T T F F
F T F F F
F F T T F
F F F T F

Step 4 - Completed truth table showing the solution for (m $\wedge\sim$ n)$\rightarrow$ p

Table 4.2.17 — Completed Truth Table for Example 3.
Completed truth table for Example 3 denoting the solution in row 5.
m n p $\sim$n m $\wedge\sim$ n (m $\wedge\sim$ n)$\rightarrow$ p
T T T F F T
T T F F F T
T F T T T T
T F F T T F
F T T F F T
F T F F F T
F F T T F T
F F F T F T

We can see from the table that this compound statement is true in most cases except for when m is true statement, n is a false statement, and p is a false statement. Additionally, it has been highlighted in the table.