Some of my favorite puzzles to create are logic puzzles. There are many reasons for this — you can often create humorous scenarios for your puzzles (like Trolls wearing hats). Also, there are typically multiple entry points into a solution — you can start with any clue you like!
I’ll let you do a review of simple logic; you should be familiar with truth tables, conjunctions, disjunctions, implications, and biconditionals, for example. In this week’s post, we’ll start by solving a simple puzzle — and in doing so, discuss several tricky points in working with mathematical logic.
We begin in the Land of Pergile, where four friendly trolls — Cedric, Dillon, Elbyn, and Fenn — are wearing four different but brightly colored hats of the red, blue, green, and yellow varieties. Here’s what you know:
- Dillon is wearing a yellow hat if and only if Elbyn is wearing a green one.
- Either Dillon is wearing a red hat, or Fenn is wearing a yellow hat.
- If Dillon is wearing a red hat, then Cedric is wearing a blue one.
- Cedric’s hat is either red or yellow.
- If Cedric’s hat is blue, then Elbyn’s is green.
Where to begin? Let’s look at clues 3 and 4. Suppose Dillon’s hat is red. Then from clue 3, Cedric is wearing a blue hat. But clue 4 says his hat is either red or yellow — not blue. So our original assumption that Dillon’s had is red must be false. Therefore, we know that Dillon is not wearing a red hat.
Now since Cedric’s hat is either red or yellow, it can’t be blue. So from clue 5…well, nothing. Remember that if the antecedent of an implication is false, you can’t conclude anything about the consequent. In other words, since Cedric’s hat is not blue, you can’t conclude that Elbyn’s hat is green — but you can’t conclude that his hat is not green, either. So we really can’t learn any more information from clue 5.
Now let’s look at clue 2. Keep in mind that it is possible for both Dillon to be wearing a red hat and Fenn to be wearing a yellow hat. In general, a disjunction (that is, an “or” statement) is inclusive. (Although in clue 4, this is certainly not possible — but in general you have to consider that both clauses in a disjunction may be true.)
Now we’ve already established that Dillon is not wearing a red hat — so that means that Fenn must be wearing a yellow hat. At least one clause in a disjunction must be true. Then we use clue 4 to establish that Cedric must be wearing the red hat, since Fenn is wearing the yellow hat.
We haven’t used clue 1 yet. Recall that in a biconditional statement, both clauses have the same truth value — both are true, or both are false. In this case, they can’t both be true, since we already know that Fenn is wearing the yellow hat. So they must both be false.
Therefore Dillon is not wearing a yellow hat, which doesn’t really help us since that fact gives us no information about the color of hat he is wearing. But also, Elbyn is not wearing a green hat — and since the red and yellow hats are already accounted for, he must be wearing the blue hat. That leaves Dillon wearing the green hat.
Problem solved! Now if you know your way around logic problems, this might have seemed simple. But if you’re new to them, you realize you have to be very careful about the conclusions you make.
Of course maybe you just guessed the right answer and found no contradictory statements. But part of solving these problems is showing that you’ve found the only solution — and that means using the rules of logic to exclude all other possibilities.
And of course you might used the clues in a different order. You can eliminate any help from clue 5 by looking at clue 4 first, and then consider clue 3. Or you can take a completely different approach with clue 1. For example, if Dillon’s hat is yellow, then neither clause in clue 2 can be true — which yields a contradiction. So Dillon’s hat can’t be yellow. The point is that there is not just one way to solve any of these problems — which is part of the fun! But you’ve always got to make some tentative decision about where to begin.
Now here’s one for you to figure out. As it happens, the four friendly young Trolls decided to skip school one Afterday morning and go shopping for new hats! Excited — though not particularly adventurous — they each bought another hat which was either red, blue, green, or yellow. (It is possible that a Troll bought the same color hat as he was already wearing.) From the following clues, can you deduce what colors their new hats are?
- If Fenn bought a green hat, then Dillon bought a yellow hat.
- After all the new hats were purchased, either Cedric and Dillon did not share a hat of the same color, or Elbyn and Fenn did not share a hat of the same color.
- If Cedric’s new hat was blue, then Elbyn’s new hat was green.
- Either Dillon or Fenn bought a new blue hat.
- If Dillon did not buy a hew red hat, then Elbyn did.
- If Cedric bought a new yellow hat, then so did Fenn.
You can easily create logic puzzles of your own. I find it easiest to start with a solution, write clues which describe the solution, and then see if you have enough clues as well as check that the solution is unique. There’s a certain amount of back-and-forth work here — you don’t always get it right the first time…. The second problem took a little while to get the clues right — I wanted a variety of clues (sharing the same color hat, implications and disjunctions, etc.), and I wanted to make sure there was a clear solution path. Maybe you’ll find it…..
Finally, here’s another short puzzle to test your logical prowess. After their hat-buying excursion, Cedric decided to go to the local produce stand, where he bought a basket of his favorite fruits: apples, bananas, and choobles. In all, he bought ten pieces of fruit. Given the following true statements made by Cedric, how many pieces of each fruit did he have in his basket?
- If I don’t have more choobles than bananas, then I have two more apples than bananas.
- If I have more choobles than bananas, I have three apples.
- If I have fewer than four apples, then I have the same number of bananas as choobles.
- The number of pieces of one of the fruits is the same as the sum of the number of pieces of the other two fruits.
2 thoughts on “Logic Puzzles I”
5 apples, 2 choobles and 3 bananas.