Lesson Three - Truth Tables: And, or, and other Boolean operators

Let us explore the funny meaning of and and or.

New terms in this lesson:
and, or, truth table, propositional expression, truth value

In Boolean Logic, A is either true or false. What is or? What is and?
What do you mean when you say and? What do you mean when you say or?
Can you come up with some alternative definitions of and and or?
and � additionally, both, all, as well as
or � either, optional, one of

What do and and or actually mean? Mathematicians cannot stand the multiple definitions of and and or because they cause ambiguity. Instead, they defined unique, very specific definitions for and and or. These mathematical, carefully defined words are somewhat different from our everyday English or or and, so mathematicians use a unique symbol to represent them. The the symbol  represents or. So 4 or -4 would be written 4  -4.

Similarly, mathematicians use  to represent and. 4 and -4 would be written 4  -4.

So what do the mathematical or and and mean? If statement A and statement B is true, this means that both statements must be true. If statement A or statement B is true, then at least one of them must be true.

These definitions arenít really very different from the everyday forms of and and or you are already familiar with. Imagine you ordered a jacket off the internet. The seller could not guarantee you a particular color, but the website said it would be either ďblue or green.� Imagine your surprise, then, when you open the shipping box you pull out a red jacket. The promise from the seller was false, because neither of the statements was true; the jacket was not blue or green. In order for an or expression to be true at least one of the statements must be true.

Now imagine youíre shoe shopping online and you find a pair of sneakers you like that are black and red. The website says that the shoes you will receive are the same as the ones pictured, but when your pair arrives they are solid black! The promise from the seller was, once again, false, this time because only one of the statements was true. The shoes are black, but not red. In order for an and expression to be true both of the statements have to be true.

Expressions using and and or can get very complicated so to help us evaluate them we can use a truth table. A truth table is an organized way to evaluate a set of statements using different givens. It allows you to experiment with different assumptions to see which one works best and to see if an expression is true with a variety of givens or only under certain conditions.

Truth tables use columns to represent the pieces of an expression and rows to represent the different starting assumptions that can lead to different conclusions.

Look at the truth table below to evaluate the expression A and B or A  B. First you will see that we have a column for each statement � in this case a column for statement A and a column for statement B. We also have a column for the propositional expression A and B. A propositional expression is a statement connected with and's and or's that has a truth-value. A truth-value is the final conclusion of an argument, either true or false. In other words, we can evaluate a propositional expression to be either true or false. When using a truth table, we aim to find all possible outcomes for our expression: these are the rows in the table. Each row represents a different scenario, a different set of pre-existing assumptions to test the expression with. To do this we must evaluate all possible combinations of A and B.

In creating the truth table we fill in the boxes below each statement with a series of true and false. There are four possible true/false combinations for two assumptions: A and B can both be true, only A could be true, only B could be true, or A and B could both be false. Our table needs four rows to represent these four cases. We then look to these to evaluate the expression A and B. For and, our rule is that if both statements are true, then our expression is true.

A B A and B
True True True and True = True
True False True and False = False
False True False and True = False
False False False and False = False

Looking at our truth table we can see that the propositional expression ďA and B� was only true in one case. For the expression to be true we have to assume that both A and B are true.

A B A or B
True True True or True = True
True False True or False =True
False True False or True =
False False False or False =

Below is a truth table for or. Again we fill in the true and false pattern below the statements and evaluate the expression A or B. Or follows a very different rule: If at least one of the statements is true, then the expression will be true. Look at this truth table below and try filling in the last two boxes below A or B.

You can see that there is a big difference between the and truth table and the or truth table. Whereas for and, both statements had to be true, just one of them had to be true for or. That is the difference between one true scenario and three. That is significant!

In everyday life we are constantly choosing things using and and or. Have you ever said, ďI want the white and blue shoes, or the black boots,� or something similar? You are using and and or in very powerful ways. Because these words connect two or more ideas, they are also called connectives. When you use and and or in a mathematical sense, you have to be very careful!

Thinking back to our last lesson, we worked with the given |x| = 4. Letís look at the differences between [x = 4 or x = -4] and [x = 4 and -4]. Which one of these expressions is true for sure, without any doubt?

Thinking back to our last lesson, we worked with the given |x| = 4. Letís look at the differences between [x = 4 or x = -4] and [x = 4 and -4]. Which one of these expressions is true for sure, without any doubt?

Look at [x = 4 or x = -4]. Letís think about some things we know about this statement. The two cases do not have to be true at the same time. At least one of them is true. They are not both false, although one of them has to be false because x cannot be both 4 and -4 simultaneously! This is the only answer a mathematician would consider a true for sure statement.

Now look at [x = 4 and x = -4.] Would you say this expression is true, without a doubt? Hopefully not! It looks like it could make sense, but from a mathematical standpoint it does not work because both would have to be true at the same time due to the use of and. This is not correct because x can only equal one of the values at a time. Only one of the two can be true. Thatís why we use or to distinguish one from two or more values.

The and and or symbols are often used in combination with the not symbol, as in not A. This means the opposite of A. Remember we introduced this symbol in lesson 1.

Mathematicians use the symbol � to represent not. So an expression could read like this: [A  � B]. Using words you would say it: A and not B.

Using our new symbols, how would you write A or not B?

Letís use our new symbol � in a truth table. We want to complete the table for the expression [A  � B]. For this truth table we need at least three columns: one for each of the statements (A and B) and one for the propositional expression. However, it is in our best interest to add one more column to simplify our evaluation. Within our longer expression is the smaller expression ď¨ B�. We give this its own column so that we can evaluate it first, then do the longer expression.

A B � B (opposite of B) A  � B
True True False True and False = False
True False True True and True = True
False True False False and False = False
False False True False and True = False

Evaluating Propositional Expressions with Multiple Components

With a good understanding of the differences between  and , we can make expressions longer and more complex. The truth table grows along with the expression. As the expressions get more complicated you will need to add columns, as the assumptions increase in number you will need to add rows.

Letís make a truth table for A  B  A (A and B or A). The easiest way to solve a multipart expression is to break it down so that you are never solving for more than two statements at a time. To start with, letís ignore the end of the expression and just work on the beginning. A  B is our first part.

Before we solve for this expression, what is the rule for ? Remember that both statements have to be true for the expression to be true.

A B A  B A  B  A
True True True and True = True
True False True and False = False
False True False and True = False
False False False and False = False

We have solved the first part of the expression; this first part of the expression now acts as a single unit, a single statement, because we have evaluated it for a true or false answer. We effectively are now evaluating for [A  B]  A, so we are still only working with two statements at a time.

Before we solve for the expression A  B  A, letís review our rules . Remember for  to be true, at least one statement must be true. Can you fill in the table? You need to compare the condition of [A  B] and the condition of A and remember that you are evaluating for or, .

A B A  B A  B  A
True True True and True = True True and True =
True False True and False = False False and True =
False True False and True = False False and False =
False False False and False = False False and False =

Lesson Three Exercises

A. Sense from Nonsensei - Answers may vary

Punctuate the following fragments so that they make sense:

  1. It was and I said not or
  2. Picture this a grey squirrel deep in the forest nibbles on the yummies of its environment fruits seeds anything fresh and pluckable