10 prisoners are lined up, each wearing a black or white hat
10 prisoners are lined up, each wearing a black or white hat. Each prisoner can see the hats of everyone in front of them, but not their own or those behind. Starting from the back, each one, in turn, must say only "black" or "white" to guess their own hat color — everyone else can hear, and a plan can be agreed beforehand. Ojas thinks that no matter what plan is made, everyone's chance of being right stays a flat 50%. His teacher says a clever plan can guarantee almost everyone survives. Who is right?
Who do you think is right? Pick one.
The answer: His teacher is right — the first speaker signals a count, letting everyone else guess with certainty
Why
Ojas is imagining every prisoner as isolated, guessing blind with no real information — which would indeed cap everyone at 50-50. But this ignores the biggest resource the group has: every prisoner ahead in line HEARS every word said before their own turn, not just their own eyesight. The prisoner speaking first (who can see everyone else's hats) sacrifices certainty for themselves to send one crucial piece of information: they count the black hats they see, and say 'black' if that count is even, 'white' if it is odd — a single word that secretly encodes a count. Every prisoner after that can also count the black hats they see ahead of them, combine that with what has been said by everyone between them and the first speaker, and work out their OWN hat color with total certainty — because they know the running count had to work out to a specific parity, and their own hat is the only unknown left in that count. Test it on a tiny case: with just 2 prisoners, the back one says 'black' if the hat they see is black, 'white' if white — literally just announcing what they see — and the front prisoner, now told exactly what color is ahead, deduces their OWN hat must be the opposite color signal relative to what was actually true, working out from there. His teacher is right: the first speaker encodes information instead of just guessing, letting every other prisoner reason out their own hat with certainty — only the very first speaker's own survival stays a coin flip.
On Socho, you explain your thinking out loud and a coach asks about YOUR reasoning — one question a day, free, in Hindi, Hinglish or English.
Try a question on Socho →More disagreements in Classic Mind-benders