Friday, July 25, 2008

An Evil King

There is an evil king, who takes six gnomes prisoner. However, deep down he is slightly merciful, so he will give them one chance to earn their freedom. He lines them all up so that the first in line can see straight ahead, the second can see the back of the first, the third the back of the second and first etc. etc. Taking out a bag of orange and pink hats, he tells them that he will place one on each of their heads and if they can guess the color of the hat on their head they can go free. (They can come up with a strategy beforehand.) How many of them can survive?

Coming up with a strategy:

The evil king lines them up:


He places the hats on their heads...:


...but on the first try, the gnomes fail.

The second group devises a touching strategy. When one gnome guesses the color on the top of their head, they will poke the back of the gnome in front of them if that is also their hat color.


And they all survive!


But what if no touching is allowed? An alternate strategy is to use the principle of odds and evens. Before starting, the group will determine whether "pink" or "orange" means an odd or even number of one color of hats. For example, they may decide that "pink" means an odd number of pink hats, and "orange" means an even number of pink hats. Then, the gnome in the back of the line will count how many pink hats there are, and say "pink" or "orange" depending on whether the number is odd or even. The second to last gnome will then be able to look ahead and determine what color of hat he/she has. While the gnome in the back will have a 50-50 chance of survival, everyone else will survive.

No comments: