Quant Memo
Brainteasers/●●●●

100 prisoners guessing hat colors in a line

Asked at Jane Street, Citadel, SIG

100 prisoners stand in a line. Each wears a hat that is red or blue (assigned adversarially). Each prisoner sees the hats of everyone in front of them but not their own or those behind. Starting from the back (who sees the other 99), each prisoner in turn calls out a single guess, "red" or "blue", loud enough for all to hear. A prisoner survives if their guess matches their own hat.

The prisoners agree on a strategy beforehand. They cannot pass or say anything but a color.

How many prisoners can be guaranteed to survive, and how?

Show a hint

The back prisoner can encode one bit of information for everyone else. What single bit summarizes all the hats they can see?

Your answer

More Brainteasers questions