Prisoners and Hats and a Jungle, Oh My!

Jul 02, 2011

RAY: At certain jungle prison, there are 30 prisoners who have been sentenced to be executed. Yikes! The warden, of course, has the power to pardon, and he decides to play a little game. Of course he does, right?

He announces to the prisoners that he will stand all of them in a straight line, with Prisoner Number 1 facing the wall, and the remaining prisoners lined up behind him, with each one able to see the heads of those prisoners in front of him, but not his own head of course, or those heads behind him. Kinda like standing in line at the men's room at the ol' ballpark.

Next he will place either a white or a black hat on each prisoner's head, starting at the back of the line, and a guard will then ask each prisoner, starting at the back of the line, we'll call this Prisoner Number 30, to identify the color of his own hat.

Remember, Prisoner Number 30, the one at the back of the line, can see all the other hats and prisoners in front of him. Number 29 can see the 28 hats in front of him, et cetera, et cetera, et cetera, but Prisoner Number 1 can see what?

TOM: Bupkis!

RAY: Exactly right. Of course, each prisoner can hear each of his fellow prisoners attempt to identify the correct color of his hat. When asked the color of his hat, a prisoner can say only one of two words: black, or white. That's it. Now he explains this to the prisoners, and immediately they come back and say, "Hey, come on man, give us a fighting chance! If we've only got a 50/50 chance of making it here, give us something we can do to help improve the odds."

He says, "Alright, alright, look, I hate to execute complainers, so I'll give all of you one hour to talk among yourselves and come up with a strategy. After that, silence. And remember, no funny business. Each one of you is allowed, when asked, to utter one word and one word only, either black or white. If I suspect anything is amiss, you all die."

So the question is, is there a strategy that they can use that will improve their chances, and if so, what is it?

Notice, by the way, that I did not say how many black or how many white hats there were; it doesn't matter.
Answer: 
RAY: Here's what the prisoners do. They decide if Prisoner Number 30, the guy at the end of the line, looks ahead and sees an odd number of black hats, he says, "I have a black hat." If he sees an odd number of white hats, he'll say, "I have a white hat."

Now, here's how this works. Prisoner looks up and sees one white hat. So he says, "I have a white hat." Well, two bad for him, because he happens to wearing a black hat. So they take him outside, and he gets what, two in the back.

But Prisoner Number 29, the guy right in front of him, he looks ahead, and he sees that one white hat, and he says, oh, if Prisoner Number 30 said that he had a white hat, that must mean he saw an odd number of white hats. I see an odd number of white hats, too. Therefore I have a black hat.

And so Prisoner Number 28 says the same thing. Prisoner Number 27 says the same thing, and so on until we get to Prisoner Number 10.

Prisoner Number 10 says, hm, all these guys behind me have said that they have black hats, because they're seeing an odd number of white hats. I don't see any white hats. Therefore, I must have the white hat.

TOM: Good, good.

RAY: Prisoner Number 9 looks ahead. He doesn't see any white hats. He knows the guy behind him declared that he had a white hat. And he knows there's an odd number of white hats, and he cannot have a white hat.

TOM: Ah.

RAY: And each of the remaining prisoners, all of whom have black hats use the same rationale to declare that they also have black hats. So who's our winner?

TOM: Our winner this week is Leslie Warren from Lawrence, Kansas. Congratulations, Leslie!

Get the Car Talk Newsletter