The Three Hats, Solved

Cowboy hats

Yesterday, I shared the following puzzle. Scroll past the Patreon block for the answer!

* * *

The puzzle, in case you missed it:

There are three logicians — that is, people who are really, really, good at logic and reasoning, so much so that it’s their job. They’re standing in such a way that they can see the other two. Like, in a triangle formation.

The game master enters the room and informs them that he has with him five hats. Three are white and two are black. He’s going to put one hat on each of logicians’ heads. At no point will any of the logicians be able to see what they have on their own heads, but they will be able to see what the others are wearing. Oh, and the game master is going to hide the other two hats; at no point will the logicians see which hats are hidden.

So, that happens, and now we have three logicians wearing hats.

The game master then says:  “Raise your hand if you know what color hat you have on your head.”

A moment or two passes. No one responds. He repeats the command.  “Raise your hand if you know what color hat you have on your head.”

Another moment or two passes. No one responds. He repeats the command again. “Raise your hand if you know what color hat you have on your head.”

What happens, and why?

* * *

The answer is below, after the Patreon message.

Let’s put ourselves in the shoes — or, I guess, the hat — of one of the logicians. But first, let’s set up some combinations. What are the possible hat combinations?

There are only two black hats, so here are only three possible combos:

  • Three white hats (WWW)
  • Two white hats and a black (WWB)
  • One white hat and two black (WBB)

Similarly, our logician and see three possible combinations on the heads of others:

  • Both are wearing white hats (WW)
  • One is wearing a white hat and the other is wearing a black hat (WB)
  • Both are wearing black hats (BB)

Now, to the game. Seeing WW or WB doesn’t give our logician enough information. Seeing WW could mean there are three white hats or that there are two whites and a black out there. Similarly, seeing WB would have meant that our possible combos are WWB or WBB. On the other hand, had our logician seen BB, she would have immediately known that she had a W on her head, as the only combination that allows for that is WBB, and she can see the black hats.

But note that when the game master first asks our logician to raise her hand, she doesn’t — that means she lacks the information to make a pronouncement as to what is on her head. So she couldn’t have seen BB. She had to see either WW or WB.

And — here’s the tricky part — that’s true for all three logicians. None of them could have seen BB for the same reason. So, everyone saw either WW or WB. And, as no one saw two black hats, we can eliminate WBB as one of the potential combinations. We’re left with

  • Three white hats (WWW)
  • Two white hats and a black (WWB)

The game master then repeats his command — raise your hand if you know what you have on your head. And again, no hands go up.

Seeing WW doesn’t give our logician enough information — both WWW and WWB are still viable outcomes. But, had our logician seen WB, she would have immediately known that she had a W on her head. And again, she didn’t know what she had on her head, so again, we can eliminate that option. She sees WW.

And again, that’s true for all three of our players. At the second request to raise hands, no one did; therefore, no one could definitively say what they had on their heads. Therefore, everyone saw WW. And therefore, everyone is wearing a white hat.

So: the third time the game master asks our logicians to raise their hands, all of them do, as they all know they have white hats.

* * *

Want a slightly harder version of this puzzle? Here you go, via FiveThirtyEight’s Riddler (I added the emphasis so you can see the difference):

Three smart logicians are standing in a line, so that they can only see the logicians in front of them. A hat salesman comes along and shows the three logicians that he has three white hats and two black hats. He places one hat on each logician’s head and hides the remaining hats.

He then says to the logicians, “Can anyone tell me what color hat is on her own head?” No one responds.

He repeats, “Can anyone tell me what color hat is on her own head?” Still no answer.

A third time: “Can anyone tell me what color hat is on her own head?” One of the logicians speaks up and gives the correct answer.

Who spoke, and what color hat is on her head?

The solution is available at their subsequent Riddler column, here — you’ll need to scroll a bit.

WeekenderAdUnits