We introduce two hat puzzles from Peter Winkler's "Games People Don't Play". There may be many variants of it. I will introduce them one by one. The following two are taken directly from the paper.
Colored Hats (simultaneous version)
Each member of a team of n players is to be fitted with a red or blue hat; each player will be able to see the colors of the hats of his teammates, but not the color of his own hat. No communication will be permitted. At a signal, each player will simultaneously guess the color of his own hat; all the players who guess wrong are subsequently executed.
Knowing that the game will be played, the team has a chance to collaborate on a strategy (that is, a set of schemes--not necessarily the same for each player--telling each player which color to guess based on what he sees). The object of their planning is to guarantee as many survivors as possible, assuming worst case hat distribution.
In other words, we may assume the hat distributing enemy knows the teams strategy and will do his best to foil it. How many players can be saved?
Colored Hats (sequential version)
Each of a team of n players will be fitted with a red or blue hat; but this time the players are to be arranged in a line, so that each player can see only the colors of the hats in front of him. Again each player must guess the color of his own hat, and is executed if he is wrong; but this time the guesses are made sequentially, from the back of the line toward the front. Thus, for example, the i-th player in line sees the hat-colors of players 1,2,...,i-1 and hears the guesses of players i+1,...,n (but he isn't told which of those guesses were correct--the executions take place later).
As before the team has a chance to collaborate beforehand on a strategy, with the object of guaranteeing as many survivors as possible. How many players can be saved in the worstcase?