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:

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.
I would answer, but I heard this riddle during an interview about a month ago. As a result, I will not say anything.
Blake, I think you have stumped the internet. What’s the answer?
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.
That was very difficult. I was wracking my brain for a week trying to figure it out. It’s a good one though.
umm doesent make sense!
@Ron: what doesn’t make sense? The riddle or the solution?
Can you shout
@Edwin: if a prisoner shouts something other than the color of his own hat, the king kills him.
This is impossible…. =(
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