A stark raving mad king tells his 100 wisest men he is about to line them up and that he will place either a red or blue hat on each of their heads. Once lined up, they must not communicate amongst themselves. Nor may they attempt to look behind them or remove their own hat.
The king tells the wise men that they will be able to see all the hats in front of them. They will not be able to see the color of their own hat or the hats behind them, although they will be able to hear the answers from all those behind them.
The king will then start with the wise man in the back and ask "what color is your hat?" The wise man will only be allowed to answer "red" or "blue," nothing more. If the answer is incorrect then the wise man will be silently killed. If the answer is correct then the wise man may live but must remain absolutely silent.
The king will then move on to the next wise man and repeat the question.
The king makes it clear that if anyone breaks the rules then all the wise men will die, then allows the wise men to consult before lining them up. The king listens in while the wise men consult each other to make sure they don't devise a plan to cheat. To communicate anything more than their guess of red or blue by coughing or shuffling would be breaking the rules.
What is the maximum number of men they can be guaranteed to save ?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Their plan is for the first wise man to stand up and announce the colour of odd numbered hats; whether he lives or not is a coin toss. The next man can use this information and deduce the colour of the hat he is wearing.For example, let say 12 of the wise men are wearing blue and 88 of them are wearing red and that the first man in line is wearing red. He stands up and sees 12 blue hats and 87 red. He announces "red". Luckily for him he will live. The rest of the men take note that there are an odd number of red hats and an even number of blue hats remaining (this is because there are 99 men left and odd + even = odd). The next man (assume his hat is blue) stands up and sees 11 blue hats and 87 red hats. He knows that his hat must be blue because the last man announced that he saw an odd number of red hats and therefore there has to be an even number of blue hats. He announces "blue". Everyone now keeps track and realizes there are an odd number of red hats and an odd number of blue hats remaining. The next man stands up (assume he is wearing blue as well) and sees 10 blue and 87 red. Knowing that there are an odd number of red hats and blue hats remaining, he knows his hat must be blue as well. This goes on until the very end and assuming nobody messes up and the first guy isn't a jerk, 99 people are guaranteed to live.