"Nasty predicament" logic-type conundrum

Hoping that the following has not already featured in The Game Room: it’s a logic-type problem which I recently encountered, and found fiendish and beyond my capacity to solve – after “step 1”, I was totally “stumped”. I don’t know how to carry out the “Spoiler-and-hide” manoeuvre – perhaps as a “Guest”, that is debarred to me – so plan to, after this post: inaugurate a separate thread, with the answer, including generous “spoiler space” (mods, please intervene if deemed appropriate).

The problem:

Three men are captured by cannibals in the jungle. They are given one chance to escape with their lives. The men are lined up and bound to stakes, such that the rear man can see the backs of the other two, the middle man can see the back of the front man, and the front man can’t see anybody. The men are shown five hats, three of which are black and two of which are white. Then the men are blindfolded, and one of the five hats is placed on each man’s head. The remaining two hats are hidden away. The blindfolds are removed. The men are told that if one of them can guess what colour hat he’s wearing (one single guess by one single man, “first-and-only”), they may all go free. Time passes. Finally the front man, who can’t see anyone, correctly guesses the colour of his hat. What colour was it, and how did he guess correctly?

S

P

O

I

L

E

R

S

P

A

C

E

The rear man can see the hats worn by the two men in front of him. So, if both of those hats were white, he would know that the hat he wore was black.

But, since he doesn’t answer, he must see at least one black hat ahead of him. After it becomes apparent to the middle man that the rear man can’t figure out what he’s wearing; middle man knows that there is at least one black hat, worn by himself and / or the front man. With this known: if the middle man saw a white hat in front of him, he’d know that his own hat was black, and could answer the question correctly. But since he doesn’t answer, he must see a black hat on the front man. After it becomes apparent to the front man that neither of the men behind him can answer the question, he realises that the middle man saw a black hat in front of him. So he says, correctly, “my hat is black”.

To do a spoiler you just put the word “spoiler” into [square brackets] the same as if you were doing a “b” for bold or a “quote” to quote.

Here’s my solution:

[spoiler]If he’s wearing a white hat, then either he and the guy behind him are both wearing white hats, or he’s wearing a white hat and the guy behind him is wearing a black hat. Guy #2 knows this as well.

If 1 and 2 are both white, then #3 should know he can’t be wearing white, so he should say “Black.” He doesn’t say that. So that’s out; it’s not white-white. Therefore, if #1 is wearing white, #2 should know that he isn’t also wearing white, because #3 didn’t say black. So #2 should then say “Black” if he’s looking at a white hat and #3 hasn’t indicated that he sees two white hats. But he doesn’t say that. Therefore #2 must not be looking at a white hat. So #1 should say “Black.”[/spoiler]

Thanks ! For this one, I’ve done what I’ve done; but I’ll take note, and know for next time.

I arrived at the same answer, but my logic was the other way around.

[spoiler]
Rear guy can see two hats. If he sees WW, then he can say with certainty that he is wearing B immediately. He does not, therefore he sees either WB or BB.

Middle guy can see one hat and knows that rear guy has failed to say B. If he sees W, then he can say with certainty that he has B. He does not, therefore he sees B.

Front guy waits for both of them to work through the same logic, hears nothing, and concludes that he does in fact have a black hat.[/spoiler]

Working this out without reading other responses.[spoiler]Let’s call the three guys Al, Bill, and Chuck from front to back.

There are only two white hats. If Chuck could see that Al and Bill were wearing white hats, he would know his own hat is black by default. So if Al and Bill are wearing white hats, Chuck will shout out “I’m wearing a black hat” and they all go free.

But Chuck doesn’t do this, so everyone figures out that Al and Bill aren’t both wearing white hats. So now let’s say Al is wearing a white hat. Bill would see this and knows that they’re not both wearing white hats. So if Al is wearing a white hat then Bill must be wearing a black hat. Bill could yell out and set everyone free.

But Bill, like Chuck, says nothing. So Al now knows he isn’t wearing a white hat and must, by default, be wearing a black hat. Al says so and everyone’s released.[/spoiler]

A somewhat similar joke.

Three logicians walk into a bar. The bartender asks them “Do all three of you want a beer?”

The first logician says “I don’t know.”

The second logician says “I don’t know either.”

The third logician says “Yes, we do.”

I’ve never got the three-logicians joke before now – with its parallel to the cannibals puzzle now being pointed out. Call me stupid…

Here’s my reasoning, without reading the other responses:

If the man at the back could see two white hats, he would immediately be able to correctly say that his hat was black. He doesn’t do so, therefore he must be seeing either two black hats, or a black hat and a white hat. The man in the middle, having worked this out, would be able to correctly say that he was wearing a black hat if he could see the man in front of him wearing a white hat. He doesn’t do so, therefore the man at the front is able to correctly say he is wearing a black hat.

Having written the above, I checked the spoiler boxes and see we all thought much the same way.

Haven’t looked at any other answers. Here’s my attempt:

  1. If the first two men were wearing white hats, the third man would know he was wearing black. There is no other way he can know his hat colour for sure. He doesn’t say anything, therefore the first two men know that they cannot both be wearing white hats.

  2. The second man knows that if the first man is wearing white, he must be wearing black, because they aren’t both wearing white. He doesn’t say anything, so the first man isn’t wearing white.

  3. The first man now knows that he is wearing black.

Merged the question and answer threads, it really doesn’t need a separate one.