Home > Riddles > Riddle – Prisoners and Hats

Riddle – Prisoners and Hats

My grade twelve calculus teacher asked our class this five years ago. I like this riddle a lot because of the elegance and simplicity of its solution 😛 :

A sadistic prison guard plays a game with 10 of his prisoners. He has the prisoners all line up facing one way so the one at the front of the line is #1 and the one at the back is #10.

After lining them up, the guard then places either a red hat or a blue hat on top of each prisoner. The prisoners can’t see their own hat colour, but can see the hats of all prisoners in front of them (ie #10 can see the hats of the 9 people in front of him, #8 can only see the 7 hats in front of him etc…). The guard then goes up to #10 and asks what colour his hat is. #10 can respond only either “red” or “blue”. If he is wrong, the guard will shoot him; otherwise, he’s free. Regardless, the prisoner then proceeds to #9 and asks the same thing, then to #8, etc.

Once a prisoner announces either “red” or “blue” all the other prisoners will hear it although they won’t know the fate of that one prisoner. Also assume all the prisoners have good memory so they will remember what each of the previous prisoners said (ie #8 will remember what #9 and #10 said, #7 will remember what #8,9 and 10 said etc…).

Before this game, the prisoners are allowed some time to discuss their strategy before lining up. What should their strategy be so they can guarantee to save the most lives?

Here’s an example of one possible strategy: Prisoner #10 says the colour of #9’s hat. Then #9 says that same colour he heard so he’ll live. The process is repeated with #8 saying #7’s hat colour, #6 saying #5’s hat colour etc… This will guarantee 5 lives, but isn’t the optimal strategy and you can do a lot better.

**For those who solved the riddle, please don’t post the solution in the comments so other people can still have a chance to solve it.**

Categories: Riddles
  1. March 7, 2012 at 5:23 pm

    lols. Ask me this in person. I can come up with boatloads of solutions depending on what rules are in place XD

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: