# Hat Puzzles

## The Three Hats Problem

Three people sit in a circle and have hats put on their heads, which may be black or white. No one can see her own hat. The players are told that if they see a black hat on another player’s head, they must raise their hand, and if any player can guess what color her own hat is, she should say so.

All three players are given black hats, so all three raise their hands. After a few minutes, one of the players says, “I am wearing a black hat.” How did she know?

She reasoned thus: If I (Player 1) was wearing a white hat, then Player 2 would see that Player 3’s hand is raised and know that it must be because her own hat is black. Since no one is doing that, it must be that all the hats are black.

## The Four Hats Problem

There are four people standing in a line, one behind another, although a screen hides the first in line. Each is wearing a hat she cannot see. They are told that there are two black hats and two white hats. Each person can see the hats of the person or people in front of her, except no one can see the hat of the first person in line. If any one person can say what color her own hat is, she is to say so. Who figures it out and how?

The third person in line (who can see only the second person’s hat) reasons thus: The person behind me can see my hat and the hat of the person in front of me. If they were the same color, she would know that her own hat is a different color. Since she has not spoken, it must be that my hat is a different color than the hat of the person in front of me.

## The Ten Hats Problem

Now ten people are in a line, one behind the other. Each person can see all the hats in front of them, but not their own hat or any of the hats behind them. They know that each of them is wearing either a black or a white hat, but they do not know the total number of black hats and white hats. Starting from the back, each person must say either “black” or “white,” trying to correctly name their own hat color.  They are allowed just one miss, so 9 out of 10 people must name their own hat correctly. Before the hats are placed, they are allowed a few minutes to discuss what their strategy will be. How do they do it?

The person in the back of the line has to speak first, and there is no way for her to know the color of her own hat. There is simply a 50/50 chance of getting this guess wrong. So the players collectively decide that when the person in back speaks, “black” and “white” will also function as a code. The person in back will count the number of black hats she sees. If that number is odd, she will say “black” and if that number is even, she will say “white.” The person in back may or may not get her own hat right; if she misses, then that is the one miss that is allowed. However, after that, each of the other players will be able to deduce the color of their own hat. Everyone must keep track of the odd/even “count,” noting that saying “black” switches it. The system works for any arrangement of hats. Consider the scenario below:

The person in back must go first. She sees five black hats, an odd number, so she says “black.” She is wrong about the color of her own hat, so that is the one allowed miss. The ninth person now knows that the person in back could see an odd number of black hats, but she sees only four, an even number. So her hat must have be one of the black hats the person in back saw. She therefore says “black.” Now the eighth person also sees an even number of black hats, and the ninth person’s guess of “black” resolved the discrepancy, switching the “count” from odd to even, so the eight person correctly guesses “white,” and the count stays at even. Seven and six do the same. The fifth person knows that eight through six saw even, but she sees odd, so she says “black.” Four  now knows five saw odd, but she sees even, so she says “black.” Three knows four saw even, and she does too, so she says “white.” Two knows three saw even, but she sees odd, so she says “black.” Now the person in front knows two saw odd, which means two saw the person in front’s own black hat, so the person in front can confidently say “black.”

## Red Hats and Blue Hats

This puzzle was invented by Tanya Khovanova. There are three logicians, Amber, Brianna, and Carla, each wearing a hat. They can see the colors of the others’ hats but not their own. They know that their hats were drawn from a group of three red hats and two blue ones. Amber is asked what color her hat is and she responds, “I don’t know.” Brianna is asked what color her hat is and she also says, “I don’t know.” When Carla is asked what color her hat is, she answers correctly. What color is her hat and how did she know?

To answer correctly, Carla must think about why the others answered the way they did. If Amber had seen the other two wearing blue hats, she would have known her own hat was red. Since Amber said she did not know, Brianna and Carla cannot both be wearing blue hats. Brianna must also not have seen two blue hats, for the same reason: if she did, she would know her own hat was red. Now, since Brianna knows she and Carla cannot both be wearing blue hats, if she looked at Carla and saw a blue hat, she would have known her own hat must be red. But Brianna said, “I don’t know.” Therefore, she must not have seen a blue hat on Carla. Carla considers all of this and correctly infers that her own hat is red.

## Another Three Hats Problem

Three people are sitting in a circle. Hats have been placed on their heads that are either black or white. The color of each player’s hat is determined by a coin toss, so each player has a 50/50 chance of having either a black or a white hat. The players cannot see their own hat color, but they can see the colors of the others players’ hats. In this version, the players must simultaneously either state a guess as to the color of their own hat, or remain silent. If at least one person guesses their own hat color correctly, and no one guesses incorrectly, they will share a prize. If there are no correct guesses, or if there are any incorrect guesses, they lose. They are allowed to discuss a strategy before the game begins. Is there a way they can maximize their chances of winning?