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.
| A | B | A \( \wedge \) B |
|---|---|---|
| T | T | T |
| T | F | F |
| F | T | F |
| F | F | F |
| A | B | A \( \vee \) B |
|---|---|---|
| T | T | T |
| T | F | T |
| F | T | T |
| F | F | F |
| A | B | A \( \rightarrow \) B |
|---|---|---|
| T | T | T |
| T | F | F |
| F | T | T |
| F | F | T |
| A | B | A \( \leftrightarrow \) B |
|---|---|---|
| T | T | T |
| T | F | F |
| F | T | F |
| F | F | T |
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.
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?
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:
| 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.
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.
Now we can start to construct the table:
| 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:
| 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:
| 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.
Complete the truth table for the symbolic statement $(\text{q}\rightarrow\sim\text{p})\wedge q$.
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:
| 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.
| 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.
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:
| 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:
| 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:
| 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.
Construct the truth table for the statement (m $\wedge\sim$ n)$\rightarrow$ p.
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:
| 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 |
| 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 |
| 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 |
| 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.