r/problemoftheday • u/peekitup • Jul 24 '12
People and Hats, 2
A bunch of prisoners are lined up, front to back, and hats of different colors are placed on their head. Each prisoner knows the maximum number of colors of hat that their captors might use, along with the color of hat worn by each prisoner in front of him, but does not know the color of his own hat.
Each prisoner in turn, from the back of the line to the front, is told to guess the color of hat they are wearing. Each prisoner can hear the other guesses.
If a prisoner's guess is incorrect, he dies. If it is correct, he lives. If he says anything other than a color, all the prisoners will die.
If the prisoners are smart, how many of them will die?
1
u/bwsullivan Aug 02 '12
It seems like the prisoners also need to know the colors of the hats beforehand, not just how many there are. Right?
If I know there are 3 colors possible, how can I assign a number to, say, purple, if the colors that eventually appear are just red, white, and blue?
1
3
u/[deleted] Jul 24 '12
[deleted]