The man at the back says red if he can see an odd number of red hats and blue if it is even. He has a fifty-fifty chance himself, but the next man counts the red hats in front of him, and if odd or even has changed, his own hat is red. Everyone after him does the same, keeping track of the calls behind.
Ten prisoners stand in a line, one behind the other, each wearing a red or a blue hat. Each can see every hat in front of him but not his own or any behind. Starting at the back, each must call out red or blue, and if it matches his own hat he lives. Everyone hears every call. They can agree a plan beforehand. How many can they guarantee to save?
Give me a hintThe hint
The first call doesn’t have to be a guess at his own hat. It can be a message.