Kinesys lands in front of a sign that reads, word for word: “This is a sign.” Welcome to Veritas, the planet where every inhabitant is a perfect logician and nobody ever tells a lie, not even to be polite.
At customs, a stone-faced officer explains the rules: no one leaves without passing the Test of the Hats. Liz rolls her eyes. “We just landed on the wrong planet. Again.” “Your explanation is true but irrelevant,” the officer replies.
Dord is insulted at having to prove his intelligence. M00N, on the other hand, is thrilled: she has never worn a hat, and nobody has told her yet that she has no ears to rest one on.
The Riddle
The customs officer shows the three travelers three red hats and two white hats. Then he blindfolds them and puts a red hat on each one’s head, hiding the two remaining hats. Once the blindfolds are off, each traveler can see the hats on the other two, but not his own.
He asks the first: “What color is the hat on your head?” The first looks at the other two and says he doesn’t know.
He asks the second: “What color is the hat on your head?” The second also looks at the other two and says he doesn’t know.
He asks the third: “What color is the hat on your head?” The third answers, correctly, that his hat is red, and all three are free to go.
How did he know?
Note: assume the three are perfect logicians, that is, able to instantly deduce every consequence of a set of premises.
Hint
Put yourself in the first traveler’s shoes: in what single case could he have answered right away? Then do the same for the second, remembering that he also heard the first one’s answer.
Solution
The first traveler can’t answer: this means the other two are not both wearing white hats, otherwise he would have known right away that his was red (there are only two white hats).
The second can’t answer either. But the second knows what the first has just deduced: between himself and the third, at least one has a red hat. If the third had been wearing a white hat, the second would have immediately concluded that his own was red. Since he couldn’t, the third can’t be wearing a white hat.
So the third, reasoning from the two previous answers, concludes that his own hat is red, even without looking at the others.
