*Order of Operations*

Later in this lesson we will use a truth table to evaluate the propositional expression [A B A] (A *and* B *or not* A). This is the most complicated expression we’ve seen so far and before we tackle it we need to learn a few new techniques, starting with some new symbols.

Symbols simplify expression, so it follows that the more complicated our expressions get the more symbols we need to use to make sense of them. Remember that in creating a truth table, we aim to determine all possible outcomes. To find all possible outcomes, you have to start with all possible pairings of A and B. While there is nothing wrong about writing true and false, we can also use 1 and 0 respectively to represent “true� and “false.� Computer programmers use 1 and 0 to represent true and false when writing programs; numbers are a more abstract representation than words.

Here are some examples of truth tables using 1 to represent true and 0 to represent false.

(Remember **A B** is only true if both of them are true.)

A | B | A B |
---|---|---|

1 | 1 | 1 |

1 | 0 | 0 |

0 | 1 | 0 |

0 | 0 | 0 |

(Remember **A B** is true if at least one of them is true.)

A | B | A B |
---|---|---|

1 | 1 | 1 |

1 | 0 | 1 |

0 | 1 | 1 |

0 | 0 | 0 |

(Remember ** A** is the opposite of **A**. Thus ** A** is true when **A** is false.)

A | A |
---|---|

1 | 0 |

0 | 1 |

Next we want to evaluate the propositional expression **A B A**. How do we begin to evaluate an expression that has multiple phrases? We break it down into smaller expressions, as we learned last lesson, but *how* do we break it down?

As expressions get more complex it becomes not just convenient, but necessary to break them down into steps. As you would expect, there is a specific, right way to decide what order to solve an expression in. The order that an expression should be evaluated in is called the __order of operations__.

Let’s go back to the expression **A B A** (A or B and A) to illustrate the problem we are facing and why we need the order of operations.

Assume that A=1 (A is true) and B=0 (B is false). We need to break the expression apart to evaluate it, but there are two different ways we could approach this.

You could group it like this: **(1 0) 1**. Evaluating the expression in the parentheses for “or� we see that at least one of the statements is true, so the expression is true. Now we can simplify the first expression to a single statement, this brings us to **1 1**. We evaluate for “and�; both of the statements are true, so the overall expression is true.

**(1 0) 1
= 1 1
= 1**

Alternatively, you could group the expression like this: **1 (0 1)**. Evaluating the expression in the parentheses for “and� we see that both of the statements are not true, so the expression is false. We simplify that expression to a single statement, which gives us **1 0**. We evaluate this expression for “or� and see the at least one of the statements is true, so the expression is true.

**1 (0 1)
=1 0
=1**

Although we started with the same statement **A B A** and we finished with the same result, we evaluated the expression in two different ways. In many cases, especially when working with longer expressions, evaluating an expression two different ways will result in two different outcomes. This is a problem when we are trying to reach an absolute truth, so we need a consistent __order of operations__ so that we reach a correct conclusion every time.

The correct Order of Operations proceeds as follows:

- Transcribe the letters (A,B) into numbers and write the given expression as numbers
- Perform the first instruction that applies from left to right.
- evaluate (try* to do this first)
- evaluate (then try to do this)
- evaluate (then try to do this)
- Keep on doing this until there is nothing to do.
__Underline__the result.

*There may be cases in which you cannot follow this pattern. Hence the use of *try*.

So let’s evaluate the statement again according to the instructions. In the first example, the order of our operation was unclear, we had no set order for evaluating the expression, but with order of operations there is a definite, for sure, right way.

Evaluate **A B A**, given A=1 and B=2

- Transcribe the letters into numbers and write the expression
- = 1 0 1
- Perform the first instruction that applies from left to right.
- Evaluate from left to right. Is there a ? (none)
- Evaluate from left to right. Is there an ? (Yes, one of them)
- = 1 (0 1) simplifies to 0
- = 1 0
- Evaluate from left to right. Is there an ? (Yes, one of them)
- = 1 0
- =
__1__

**Now we are prepared to evaluate the truth table for the expression given at the start of the chapter:
A B A**

Use the order of operations to complete the truth table for **A B A**

A | B | A B A | |
---|---|---|---|

Case 1 |
1 | 1 | |

Case 2 |
1 | 0 | |

Case 3 |
0 | 1 | |

Case 4 |
0 | 0 |

*Let’s evaluate each case one at a time.*

**Case** 1, A=1, B=1

- Transcribe the letters into numbers and write the expression

1 1 1

What do we do next? - Evaluate for
- There is a in the expression, at the end, so that is the section we need to evaluate first: 1 1 ( 1)
- A is false because A is true, so � 1� at the end of the expression becomes �0�
- Current expression: 1 1 0

What do we do next? - Evaluate for
- There is an in the remaining expression so that is the next part we’ll evaluate: (1 1) 0
- 1 1 is true because both statements are true so �1 1� at the beginning of the expression simplifies to �1�
- Current expression: 1 0

What do we do next? - Evaluate for
- There is an in the remaining expression. It is the last part that needs to be evaluated.
- 1 0 is true because at least one of the statements is true so �1 0� simplifies to �1�
- Current expression: 1

What do you do next? - Underline the result
__1__

**Case 4, A=0, B=0 (With so many zeros, do you think there will be any true?)**

- Transcribe the letters into numbers and write the expression

0 0 0 - Evaluate for

0 0 ( 0) 0 0 (1) - Evaluate for

(0 0) 1 (0) 1 - Evaluate for

(0 1) (1) - Underline the result

__1__

*Lastly, write these values into your table. Once completed your table will look like this:*

A | B | A B A | |
---|---|---|---|

Case 1 |
1 | 1 | 1 |

Case 2 |
1 | 0 | 0 |

Case 3 |
0 | 1 | 1 |

Case 4 |
0 | 0 | 1 |

It is much easier than it looks at first. While these truth tables are pretty abstract, they can help evaluate and prove cases, such as those cases in law. They rely on the concept of inference which you’ll remember states that if you follow correct premises, then you will reach a correct conclusions.

__Connection__: A B is the same as A B (multiplication)

1 1 = | 1 � 1 = 1 |

1 0 = | 1 � 0 = 0 |

0 1 = | 0 � 1 = 0 |

0 0 = | 0 � 0 = 0 |

The symbol essentially represents multiplication. This is one way that algebra and logic are related.

A. Evaluate the following truth table

A | B | A B A | |
---|---|---|---|

Case 1 |
1 | 1 | |

Case 2 |
1 | 0 | |

Case 3 |
0 | 1 | |

Case 4 |
0 | 0 |

A | B | A B A | |
---|---|---|---|

Case 1 |
1 | 1 | |

Case 2 |
1 | 0 | |

Case 3 |
0 | 1 | |

Case 4 |
0 | 0 |

C. Crime and Confusion � Create a 4 x 4 truth table, like the one above, to evaluate the following word problem:

One of four girls ate all the cookies in a package. Their statements are as follows:

Alice: “Emily did it.�

Emily: “Martha did it.�

Barbara: “I didn’t do it.�

Martha: “Emily lied when she said I did it.�

If only __one__ statement is true, which of the four girls ate the cookies?

**Approach:** As you know, truth tables evaluate an argument for validity. They help organize information and provide a logical method for working through a problem and reaching a conclusion. The great thing about logic is that there is a __finite__ number of solutions. Finite means that there is an exact, limited number.

To solve the problem, let’s start with what we know. We have two pieces of information that we can assume are true; these form the frame of our reasoning:

- “One of four girls ate all the cookies in a package.�
- “If only one statement is true, which of the four girls ate the cookies?�

We can assume, for sure, that __one__ girl ate the cookies and only __one__ of the statements given is true. We do not need to prove or argue these facts. If we changed these given statements the solution would change as well, but let’s not do that right now.

We can use what we know to create a truth table. Since each girl gave a statement, we have 4 cases and 4 statements to evaluate. Since we do not know which girl did it, we will assume, one by one, that each girl did it and find when only one statement is true. The truth table with our evaluation of each statement for each case looks like this:

A | B | A B A | |
---|---|---|---|

Case 1 |
1 | 1 | |

Case 2 |
1 | 0 | |

Case 3 |
0 | 1 | |

Case 4 |
0 | 0 |

Alice’s Statement | Emily’s Statement | Barbara’s Statement | Martha’s Statement | |
---|---|---|---|---|

Alice did it | ||||

Emily did it | ||||

Barbara did it | ||||

Martha did it |

Now it’s time to evaluate whether or not the other statements are true or false based on each assumption. For the first column, we assume Alice did it. Based on this assumption, which other statements are true and which ones are false? If we assume Alice did it, then both Barbara’s and Martha’s statements are true. We are looking for the case in which only __one__ statement is true, so Alice must not be guilty. Fill in the rest of the table and see how you do.

Review: Make the truth table for the equation: A B A

means *and*

means *or*

means *not*

- CyberProf(TM)