# Riddle Me This

Posted by mike d.

A riddle.

One hundred persons will be lined up single file, facing north. Each person will be assigned either a red hat or a blue hat (random assortment). No one can see the color of his or her own hat. However, each person is able to see the color of the hat worn by every person in front of him or her. That is, for example, the last person in line can see the color of the hat on 99 persons in front of him or her; and the first person, who is at the front of the line, cannot see the color of any hat.

Beginning with the last person in line, and then moving to the 99th person, the 98th, etc., each will be asked to name the color of his or her own hat. If the color is correctly named, the person lives; if incorrectly named, the person is shot dead on the spot. Everyone in line is able to hear every response as well as hear the gunshot; also, everyone in line is able to remember all that needs to be remembered and is able to compute all that needs to be computed.

Before being lined up, the 100 persons are allowed to discuss strategy (not wearing hats yet), with an eye toward developing a plan that will allow as many of them as possible to name the correct color of his or her own hat (and thus survive). They know all of the preceding information in this problem. Once lined up, each person is allowed only to say â€œRedâ€ or â€œBlueâ€ when his or her turn arrives, beginning with the last person in line. (They aren’t allowed to use code either, like using obvious different vocal pitches, or waiting to respond).
Your assignment: Develop a plan that allows as many people as possible to live. (Do not waste time attempting to evade the stated bounds of the problem â€” thereâ€™s no trick to the answer.)

If you think you know the answer e-mail it over to me at mikedidonato AT gmail D0T com.

Filed in Features
Mar 31, 2009
2:41 pm
#1 mike d. :

Winners (to be edited as more people submit answers):

Jesse and Alicia (they sent me the puzzle)
Vinay

Mar 31, 2009
3:13 pm
#2 Aaron :

I’m going to gripe because this isn’t a riddle, it’s a CS homework problem disguised as a job interview question.

Mar 31, 2009
3:50 pm
#3 Kurt from Work :

There are 100 of them, and one guy with a gun. Forget what color hat you have and jump the guy. Booyah!

Mar 31, 2009
9:11 pm
#4 sarah t. :

I just emailed you the real answer, but I think Kurt wins.