Welcome to MindCipher, a social repository of the world's greatest brain teasers, logic puzzles and mental challenges.

Prisoners and hats

100 prisoners are standing in a line each 1 seeing the back of the ones in front of him. Each prisoner is given a black or a white hat. If they can guess the color of their hat they can go away freely, but if they say anything else than black or white or do anything else then everyone stays in prison. From the last one to the first each prisoner is asked 1 by 1 their hat color. The question is what tactic should they use so that the most people get out with certainty and whats the maximum number of people that can get out of prison(this number can be checked).

Say they agree on that they code white hat as 0 and black hat as 1. The last person adds up the colors and says white if the sum is even and black if its odd. The 99th person can do this with the first 98 and from what the 100th said he can deduct what color he is since if the sum of the first 99 has the same parity as the what the last one said the hat of the 99th must be white, otherwise black. This can be continued up to the first person. Since the last person can’t be saved with certainty 99 is the maximum.



The question is badly worded. If they guess the colour of their hat they go free, but if they get it wrong, only that prisoner is forced to stay behind.

Otherwise it is clearly impossible.



Agreed, I just posted a clearer one here if you're interested: http://www.mindcipher.com/puzzles/151


Both the question and solution is badly worded.. :(



Here's a clearer version: http://www.mindcipher.com/puzzles/151

Tom Grubb

Great problem.

Check out other puzzles:

Like this? You might also like:
Attic Light Switch
What Am I?
Happy Handshaking
Submitted by
over 5 years ago
Difficulty 8.5 ?

logic brain teaser