A group of prisoners is under sentence of death and the warder decides to give them a test to gain their freedom. He tells them, "I will place a red or blue hat on each of your heads and then I'm going to arrange you in random order in a row so that no prisoner will be able to see his own hat but each one will see all the hats in front of him. Starting with the guy at the back each of you in turn must loudly say what color hat you think you have. Correct answers will go free, incorrect ones will be thrown to the alligators in the moat. I will give you time for a brief meeting before we start, so you can plan your optimum strategy."
What strategy can the prisoners - there are N of them - adopt to improve their odds above 50:50?
Hint: They need to agree on a strategy which allows each person to identify his/her own hat while simultaneously providing as much information as possible for all those in front.
All the prisoners agree that if the hat of the person in front of them is the same color as they are guessing they will simply say the color's name "Red" or "Blue". But if the hat in front of them is a different color they will say "Mine is Red" or "Mine is Blue".
This gives the next person a 100% chance to live. The unfortunate soul at the back of the line still has a 50:50 chance; however, all the rest live, thus the collective has a 0.5:N chance of survival.
Posted by Roger
on 2006-07-21 17:01:07