Skip to main content

Subsection 2.2.3 A Truth Table Definition of the Operator or

Next we’ll consider the or operator. We’ll use the symbol \(\vee \) for or, although many people use the | symbol instead. Here is the truth table for or:

\(\text {p} \) \(\text {q} \) \(\text {p} \vee \text {q}\)
T T T
T F T
F T T
F F F

We read it just as we did the truth table for and. For example, the third line says, “When p is false and q is true, then p \(\vee \) q is true”. You can remember that \(\vee \)stands for or just by remembering that it isn’t and.

The operator that we have just defined is sometimes called inclusive-or. So p \(\vee \) q is true as long as at least one of p and q is true. This definition of or is what we want when we wish to say something like, “You can come to the prom if you are a member of our class or you are the guest of a member of our class.” In other words, you can certainly come to the prom if you are both.

We could also define a version of or that is true in case exactly one of p and q is true. This version is called exclusive-or. It’s also useful. For example, it’s what we want when we wish to say something like, “You can have a red hat or a blue one.” It’s also useful in computer circuit design. So we will define a separate operator (with a different symbol) for it later. For now, just remember that p \(\vee \) q is always true except when both p and q are false

We’ll call a statement that is formed by or-ing together other statements a disjunction.

Some examples of simple disjunctions are

  • \(\displaystyle p \vee q \)

  • \(\displaystyle (p \vee q) \vee r \)

English Aside

I n English, we can say, “p or q”. We can also say, “either p or q.” Sometimes, these two forms mean the same thing. For example, these two sentences are equivalent (meaning that if at least one of wind or rain is present, there won’t be any helicopter flying):

  • The helicopter won’t fly in case of wind or rain.

  • The helicopter won’t fly in case of either wind or rain.

Sometimes, however, the word “either” is inserted specifically to indicate that an exclusive-or is intended. In other words, the combined statement is true only if exactly one, but not both, of p and q is true. For example, don’t get your heart set on two desserts if you’re told:

  • You can have either cake or pie.

In cases like this, the logical operator , as we have defined it, doesn’t capture the intended meaning. To do that requires the separate exclusive-or operator that we’ll define later.

Legal documents are supposed to be unambiguous. So this confusion between inclusive and exclusive or must be avoided. Thus legal documents often use one of these constructions:

  • p and/or q (meaning inclusive-or, so it is possible that both are true)

  • p or q but not both (meaning exclusive-or)

In this course, when we say simply, “or”, we will always mean inclusive-or. We’ll indicate exclusive-or explicitly when that’s what we mean.

Exercises Exercises

Exercise Group.

Recall the truth table for or that we just presented:

\(\text {p} \) \(\text {q} \) \(\text {p} \vee \text {q}\)
T T T
T F T
F T T
F F F

Let p correspond to the claim, “The circle is red.”

Let q correspond to the claim, “The square is blue.”

Consider the claim, “The circle is red or the square is blue.”

1.

(Part 1) Consider this situation:

Which row of the or truth table tells us whether our claim, “The circle is red or the square is blue,” is true?

  1. Line 1 and the claim is true.

  2. Line 2 and the claim is false.

  3. Line 3 and the claim is false.

  4. Line 4 and the claim is false.

Answer.
Correct answer: 2
Solution.
Explanation: p is true because the circle is red. But q is false because the square is not blue. So line 2 lets us conclude the combined claim is true. Remember that the or of two statements is true if either (or both) of the operand statements is true
2.

(Part 2) Consider this situation:

Which row of the or truth table tells us whether our claim, “The circle is red or the square is blue,” is true?

  1. Line 1 and the claim is true.

  2. Line 2 and the claim is false.

  3. Line 3 and the claim is false.

  4. Line 4 and the claim is false.

Answer.
Correct answer: 1
Solution.
Explanation: p is true because the circle is red. Now q is also true because the square is blue. So line 1 lets us conclude the combined claim is true.

Exercise Group.

Let’s practice understanding the distinction between inclusive-or and exclusive-or. Recall that:

  • p \(\vee \) q (inclusive-or) is True if and only if at least one of P, q is true.

  • p XOR q (one way to indicate exclusive-or) is True if exactly one of p, q is true.

Assume that each of the following statements is reasonable in the world in which we live. Indicate whether inclusive or exclusive or is intended:

a.

I will order chicken or fish for dinner tonight.

Answer.
Corretct answer is: exclusive-or
Solution.
b.

You’ll like the concert if you’re into percussion or you love everything Japanese.

Answer.
Corretct answer is: inclusive-or
c.

You need to get a new license if yours is more than seven years old or lost.

Answer.
Correct answer is: inclusive-or
d.

Lightening or Black Thunder will win the race tomorrow.

Answer.
Correct answer is: exclusive-or

Exercise Group.

Determine whether each of the following English statements is intended to be written using ‘inclusive or’ or ‘exclusive or”. Note that in English we use a shorthand. For example, the sentence, “My cell phone carrier is AT&T or T-Mobile,” corresponds to the logical claim:

“My cell phone carrier is ATT” or “My cell phone carrier is T-Mobile”

In each of these cases, pick the most likely interpretation in the world in which we live.

a.

My cell phone carrier is AT&T or T-Mobile.

Answer.
Exclusive
Solution.
Explanation: Very few people have cell phone accounts with both of these companies.
b.

To interview as a Software Engineer, you should be familiar with Java or C++.

Answer.
Inclusive
Solution.
Explanation: They’ll gladly hire you if you know both Java and C++.
c.

I will buy my Calculus textbook from the University Co-op or Amazon.

Answer.
Exclusive
Solution.
Explanation: Few students buy the same book from two different vendors.
d.

“The Hunger Games” is available on Netflix or Amazon.

Answer.
Inclusive
Solution.
Explanation: Most big name movies are available on both Netflix and Amazon.
e.

You can get your Bachelor’s Degree or Master’s Degree from UT.

Answer.
Inclusive
Solution.
Explanation: You can get both of those degrees from UT if you want to.
f.

You can procrastinate by going on Reddit or Facebook. (Inclusive)

Answer.
Inclusive
Solution.
Explanation: You can easily go on both and really procrastinate.