The Prisoner’s Hat Puzzle

Logic Puzzles Hard

Three prisoners are lined up single file, all facing forward. A wall separates the first prisoner from the other two. They are told that they will have either a black or a white hat placed on their head. Each prisoner can see the hats of the people in front of them, but not their own hat or the hats behind them. The third prisoner (at the back) can see the hats of the two people in front. The second person can see only the hat of the first person. The first person can’t see any hats. They are asked to identify the color of their own hat. If they guess wrong, they will be executed. If they refuse to guess, they will be imprisoned for life. How can they maximize the number of people who correctly identify their hat color?

Answer

The third prisoner counts the number of black hats they see. If it's odd, they say 'black'; if it's even, they say 'white'. The second prisoner then knows their hat color based on what the third prisoner said and what they see. The first prisoner has a 50% chance.