# Did you solve it? A head for hats

The solution to today’s problem

Earlier today I set you the following puzzle, about three extremely logical people in a line. Each person can only see who is in front of them.

A hat seller shows them three white and two black hats. She places a hat on each person and hides the remaining two.

She asks: “Does anyone know what colour hat they have?”

She repeats: “Now does anyone know what colour hat they have?”

She asks again: “Now does anyone know what colour hat they have?”

One person answers. Which person and what colour hat?

[To be clear: the people in the line can only see the hats of the people in front of them, which they know come from a set of three white and two black hats. Before the seller asks her first question they have no other information.]

Solution: the person on the right has a white hat.

What’s lovely about this problem is that the person with zero visual information at the start (they see no hats) becomes the first person to know their own hat colour. Neat!

I solved it by a process of elimination. There are only seven possible combinations of hats on the three people:

• WWW

• WWB

• WBW

• WBB

• BWW

• BWB

• BBW

[W= white, B= black, and the order from left to right.]

After the first question, there is no answer. Which means that we can eliminate all combinations that would result in any of them knowing what hat they have. So we can eliminate WBB, since if the person on the left saw two black hats, she could deduce that she has a white one.

The knowledge that WBB has been eliminated is now part of the common knowledge held by all three people.

After the second question there is no answer. Our focus moves to the middle person in the queue. If he is sees a black hat in front of him, he can deduce he is NOT wearing a black hat, since if he did have a black hat then the person on the left would have answered the first question ‘yes’. So we can eliminate all the combinations that have a B in the third place.

We are left with WWW, WBW, BWW, BBW. In all of these combinations the person on the right is wearing a white hat. Thus that person answers saying ‘I have a white hat’. None of the others know what hat they have, since the remaining options include the chances that they have either black or white.

I set a puzzle here every two weeks on a Monday. I’m always on the look-out for great puzzles. If you would like to suggest one, email me.

I’m the author of several books of puzzles, most recently the Language Lover’s Puzzle Book.

Today’s puzzle comes from Math Without Numbers by Milo Beckman, which is available on the Guardian Bookstore and other places.

Thanks to M Erazo for colouring the image above for this column. The original version appear in Math Without Numbers.

Alex Bellos

The Guardian

### Related Content

##### Can you solve it? A head for hats

Alex Bellos

11, Jan, 2021 @7:13 AM

##### Did you solve it? The puzzle of the red and green hats

Alex Bellos

29, Jan, 2018 @5:00 PM

##### Did you solve it? Puzzlebombed!

Alex Bellos

21, Sep, 2020 @4:00 PM

##### Did you solve it? Logical philosophers

Alex Bellos

23, Aug, 2021 @4:00 PM

##### Can you solve it? Gödel’s incompleteness theorem

Alex Bellos

10, Jan, 2022 @7:10 AM

##### Did you solve it? Gödel’s incompleteness theorem

Alex Bellos

10, Jan, 2022 @4:59 PM

##### Can you solve it? Gunpowder, reason and plot

Alex Bellos

05, Nov, 2018 @7:10 AM

##### Can you solve it? An Aboriginal family puzzle

Alex Bellos

03, Dec, 2018 @7:10 AM

##### Did you solve it? 24 hour puzzle people

Alex Bellos

08, Apr, 2019 @4:00 PM

##### Can you solve it? 24 hour puzzle people

Alex Bellos

08, Apr, 2019 @6:14 AM