The Prisoner's Hats

In an effort to encourage reader participation, I bring to you my first ever blog riddle. This riddle was told to me by Mike Metcalfe over dinner during the March meeting.

There was an evil king that wanted to kill 4 of his subjects, but worried that there would be an uprising if he simply had them executed, he decided to provide them with a way to escape their fate. What he did was to bury each of them in the ground up to their neck and he put a white or black hat on each of them. One of the subjects was placed behind a wall, so that he was not visible to the others. Example configuration: The Prisoner's Hats

Each prisoner could now only see what was in front of him. The king told the subjects that two of them were wearing white hats and two were wearing black hats, and if one of them could shout out the color of his own hat, all four of them would be set free. If any of them said something other than the color of his own hat, they would all be killed.

How do the prisoners escape?

The solution will be posted in the comments about a week from now, if someone out there doesn’t post it first. UPDATE: Solution now available in the comments.


10 Responses to The Prisoner's Hats

  1. 16 Martey March 25, 2006 1:13am

    I would answer, but I heard this riddle during an interview about a month ago. As a result, I will not say anything.

  2. 17 Phyllis March 27, 2006 11:36am

    Blake, I think you have stumped the internet. What’s the answer?

  3. 18 Blake April 3, 2006 12:04pm

    THE SOLUTION:

    Since there are 4 hats and 2 of each color, at least two hats to the left of the wall are the same color. If the two prisoners closest to the wall on the left have the same color hat, the guy in the back knows that his hat is the opposite color, so he can shout out the color of his hat. If the prisoner in the back remains silent, then the middle prisoner knows that the guy in the back does not see two hats of the same color in front of him. Consequently, the middle prisoner knows that his hat is the opposite color of the hat in front of him. So, he can shout out the color of his own hat.

  4. 19 DA Carlson April 5, 2006 6:24pm

    That was very difficult. I was wracking my brain for a week trying to figure it out. It’s a good one though.

  5. 33 ron January 26, 2007 12:46pm

    umm doesent make sense!

  6. 34 Blake January 29, 2007 1:38am

    @Ron: what doesn’t make sense? The riddle or the solution?

  7. 37 Edwin Cho March 26, 2007 8:52am

    Can you shout

  8. 38 Blake March 27, 2007 12:51pm

    @Edwin: if a prisoner shouts something other than the color of his own hat, the king kills him.

  9. 45 Shoe July 12, 2007 2:14pm

    This is impossible…. =(

  10. 49 ANON October 27, 2007 11:47am

    This is pretty simple. Just set up a chart and don’t worry about who is behind the wall. The only combinations are BWW-Option 1The back prisoner see’s two whites and guesses black since there are only four hats, 2 of each color. WBW-Option 2The first prisoner remains silent. Because he is silent the second prisoner knows his hat can not be the same as the one in front of him. If he was the same as the prisoner in front of him, the first prisoner could have easily guessed as in option 1. Since he know’s he is not the same hat color as the prisoner in front of him, he guesses the opposite of his color WWB-same as option 2 WBB-same as option 1 BWB-same as option 2 BBW-same as option 2

Leave a Reply