Lesson Four - Reasoning: Evaluating Boolean Expressions

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:

  1. Transcribe the letters (A,B) into numbers and write the given expression as numbers
  2. Perform the first instruction that applies from left to right.
    1. evaluate  (try* to do this first)
    2. evaluate  (then try to do this)
    3. evaluate  (then try to do this)
  3. Keep on doing this until there is nothing to do.
  4. 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

  1. Transcribe the letters into numbers and write the expression
    1. = 1  0  1
  2. Perform the first instruction that applies from left to right.
    1. Evaluate  from left to right. Is there a ? (none)
    2. Evaluate  from left to right. Is there an ? (Yes, one of them)
      1. = 1  (0  1) simplifies to 0
      2. = 1  0
  3. Evaluate  from left to right. Is there an ? (Yes, one of them)
    1. = 1  0
  4. = 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

  1. Transcribe the letters into numbers and write the expression
    1  1   1
    What do we do next?
  2. Evaluate for 
  3. Evaluate for 

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

  1. Transcribe the letters into numbers and write the expression
    0  0   0
  2. Evaluate for 
    0  0  ( 0)  0  0  (1)
  3. Evaluate for 
    (0  0)  1  (0)  1
  4. Evaluate for 
    (0  1)  (1)
  5. 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.

Lesson 4 Exercises

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.�

Case 4

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:

  1. “One of four girls ate all the cookies in a package.�
  2. “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