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?”

No answer.

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

No answer.

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.

Contributor

Alex Bellos

The GuardianTramp

Related Content

Article image
Can you solve it? A head for hats
A Q about a queue

Alex Bellos

11, Jan, 2021 @7:13 AM

Article image
Did you solve it? The puzzle of the red and green hats
The answer to today’s headwear conundrum

Alex Bellos

29, Jan, 2018 @5:00 PM

Article image
Did you solve it? Puzzlebombed!
The solutions to today’s teasers

Alex Bellos

21, Sep, 2020 @4:00 PM

Article image
Did you solve it? Logical philosophers
The solutions to today’s puzzles

Alex Bellos

23, Aug, 2021 @4:00 PM

Article image
Can you solve it? Gödel’s incompleteness theorem
The proof that rocked maths

Alex Bellos

10, Jan, 2022 @7:10 AM

Article image
Did you solve it? Gödel’s incompleteness theorem
The solution to today’s puzzle

Alex Bellos

10, Jan, 2022 @4:59 PM

Article image
Can you solve it? Gunpowder, reason and plot
A little known episode from the early seventeenth century

Alex Bellos

05, Nov, 2018 @7:10 AM

Article image
Can you solve it? An Aboriginal family puzzle
The skins they live in

Alex Bellos

03, Dec, 2018 @7:10 AM

Article image
Did you solve it? 24 hour puzzle people
The solutions to today’s puzzles

Alex Bellos

08, Apr, 2019 @4:00 PM

Article image
Can you solve it? 24 hour puzzle people
Logic problems to keep you up all night

Alex Bellos

08, Apr, 2019 @6:14 AM