Skip to main content

Subsection 2.6.2 Practice Converting Between English and Boolean Logic

To see how Boolean logic can be used, we should practice converting simple ideas into it.

Consider the sentence, “If it’s cloudy, you can’t see the stars.” To convert this sentence to Boolean logic, we begin by assigning simple variable names to the basic statements. Then we can combine them. We’ll give names to the following statements:

C: It’s cloudy.

S: You can see the stars.

Then we have: \(C \rightarrow \neg S \)

Consider the sentence, “If there aren’t any cookies, we’ll have to buy or steal some.” We’ll give names to the following statements:

C: There are cookies.

B: We have to buy cookies.

S: We have to steal cookies.

Then we have: \(\neg C \rightarrow (B \vee S) \)

We don’t actually need the parentheses here. Operator precedence will get us the interpretation that we want. But it’s always safe to use them.

Consider the sentence, “We’ll only have the party if it’s not raining or snowing.” We can give names to the following statements:

R: It’s raining

S: It’s snowing.

P: We’ll have the party.

This one is more complex. Literally, this sentence just gives circumstances under which there will be no party. But most people interpret it as giving not just necessary conditions for partying but also sufficient ones. You would think me annoying, at the least, if I said this and I had no intention of having a party under any circumstances. So let’s assume that this sentence says that we will have the party if the weather is good but we won’t if it isn’t. In other words, good weather (i.e., not rain and not snow) means party; bad weather means no party.

So we have: \((\neg R \wedge \neg S) = P \)

English Aside

In this last example, we exploited a convention for how English is used for efficient communication. We’re generally expected not to mislead. Rather, we should make the strongest statement that we believe to be both true and relevant. Our listeners, then, can assume that if we didn’t make a stronger statement it’s because such a statement wouldn’t be true. The Cooperative Principle describes a more general pattern of communication conventions that work in this way. A study of it is beyond the scope of this class, but we’ll mention it occasionally. For more information, see:

http://en.wikipedia.org/wiki/Cooperative_principle

We should point out here that there are other, logically equivalent ways of writing many complex logical statements. If you came up with something different for one of these examples, you can see whether your answer is equivalent to ours by writing out the truth tables for both our expression and yours and seeing if they’re the same.

Exercises Exercises

1.

Consider this sentence:

“If a loaf of bread costs $4 and a pound of hamburger costs $8 then John eats tofu.”

Define:

B: A loaf of bread costs $4.

H: A pound of hamburger costs $8.

J: John eats tofu.

Which of the following logical expressions captures the meaning of the sentence:

  1. \(\displaystyle B \rightarrow \neg H \)

  2. \(\displaystyle (B \wedge H) \rightarrow J \)

  3. \(\displaystyle \neg J \wedge \neg H \vee B \)

  4. \(\displaystyle (B \wedge H) \wedge J \)

Answer.
Correct answer is B.
Solution.
Explanation: \((B \wedge H) \rightarrow J \) says that if both B and H are true, then John must eat tofu.

2.

Consider this sentence:

“We’ll have chips but no peanuts at the party.”

Define:

C : We’ll have chips at the party.

P: We’ll have peanuts at the party.

Which of the following logical expressions captures the meaning of the sentence:

  1. \(\displaystyle C \rightarrow \neg P \)

  2. \(\displaystyle C \wedge \neg P \)

  3. \(\displaystyle \neg (C \wedge P ) \)

  4. \(\displaystyle C \wedge \neg P \)

Answer.
Correct is B.
Solution.
Explanation: \(C \wedge \neg P \) says that there will be chips and also there won’t be peanuts.

3.

Consider this sentence:

“If you’ve got a costume, you can come to the party unless you like loud music.”

Define:

C: You’ve got a costume.

P: You can come to the party.

M: You like loud music.

Which of the following logical expressions captures the meaning of the sentence:

  1. (CP) ∧ (¬MP)

  2. (CP) ∨ (¬MP)

  3. (MP) ∨ ¬ C ∨ ¬P

  4. (C ∧ ¬M) → P

  5. ¬MCP

Answer.
Correct answer is D.
Solution.
Explanation: \((C \wedge \neg M) \rightarrow P \) says that you can come to the as long as two conditions are met: you have a costume and you do not like loud music.

Exercise Group.

Define:

P: Pat is on vacation.

C: Chris is on vacation.

4.

(Part 1) Which of the following logical expressions corresponds to the sentence:

“Pat and Chris are not both on vacation.”

  1. \(\displaystyle \neg P \wedge \neg C \)

  2. \(\displaystyle P \neg \wedge C \)

  3. \(\displaystyle \neg ( P \vee C ) \)

  4. \(\displaystyle \neg ( P \wedge C ) \)

  5. \(\displaystyle \neg P \rightarrow \neg C \)

Answer.
Correct answer is A.
Solution.
Explanation: It’s not true that both Pat and Chris are on vacation, so the correct answer is (P  C). Another correct answer would be P  C, which says that at least one of them must not be on vacation. In the next chapter, we’ll see that we can easily derive this second statement from the first using a Boolean identity. We were careful not to put it on the list.
5.

(Part 2) Which of the following logical expressions corresponds to the sentence:

“Pat and Chris are both not on vacation.”

  1. \(\displaystyle \neg (P \wedge \neg C) \)

  2. \(\displaystyle \neg P \wedge \neg C \)

  3. \(\displaystyle P \neg \wedge C \)

  4. \(\displaystyle \neg ( P \equiv C ) \)

  5. \(\displaystyle \neg P \wedge \neg C \)

Answer.
Correct answer is A.
Solution.
Part 2: Now we have to capture the fact that the statement “not on vacation” must be true of both Pat and Chris. So the answer is \(\neg P \wedge \neg C \text{.}\) Again, there is another (not on the list) reasonable answer: \(\neg (P \vee C)\text{.}\) Again, we’ll soon see why this second answer is logically equivalent to the first one.