GamesNovatory/Enigmas/What and How (Why) ?/Hats

The original puzzle
     Three players are placed in line one in front of the other. They are shown 5 hats, 3 white and 2 black. In the darkness, a hat is placed on each head and the other 2 hats are hidden. As the lights come back : the player in back, who sees the hats of the other two, says he does not know the color of his own ; the player in the middle, having heard the one behind and seeing the hat of the one in front, says that he does not know the color of his hat either ; the one in front, having heard the other two but seeing no hats, says, on the contrary, that he knows the color of his own. What color is it and how does he know ?

This puzzle is a particular case of Hat Dispositions for a specific number of players.
In Performance, the game will consist of using all the Hat Dispositions,
presented at random, for any number of players (2 or more).

The Solution
When the player in back says that he does not know the color of his hat,
     he is telling the others that he is not seeing 2 black hats,
          because, only in this case, would he know the color of his own (white),
               there being only 2 black hats.
When the player in the middle says that he does not know the color of his hat,
     he is telling the player in front that he is seeing a white hat,
          because, had he seen black, he would have known the color of his own (white),
               because there are not 2 black hats left.
The player in front knows that he has a white hat.

Analysis
If the player in front has a white hat, he will be the only one to know the color of his own hat,
          regardless of the colors of the other two hats,
     and the Answers will always be "No, No, Yes",
          whether the Hat Dispositions be w-w-w, w-b-w, b-w-w, or b-b-w.
If the player in front has a black hat,
     and the player in the middle has a white hat,
          the player in the back will say "No", not seeing 2 black hats,
               for both the w-w-b and the b-w-b combinations,
          but the player in the middle will say "Yes", seeing a black hat,
          and the player in front will also say "Yes", knowing he has that black hat.
If the player in front has a black hat,
     and the player in the middle also has a black hat,
          the player in the back will evidently say "Yes", seeing the 2 black hats,
          and the 2 others will also say "Yes", knowing they have those 2 black hats.

If we always use the 2 black hats,
     only the position of the white hat will affect the answers -
          the b-b-w disposition will answer "No", "No", "Yes",
          the b-w-b disposition will answer "No", "Yes", "Yes", and
          the w-b-b disposition will answer "Yes", "Yes", "Yes".

A "Yes" is always followed by other "Yes"s.
     The first to say "Yes" has a white hat, and the others have black hats.
The player in front always answers "Yes",
     and also knows the colors of everyone behind who also answered "Yes".

These observations are essential to the pedagogy required for the Performance Version (Hat Magic).

A little mathematics
If the game is played with n players -
     n white hats and n-1 black hats will be used,
     producing 2n-1 possible Hat Dispositions
          (there being 2 possibilities for each player except the all-black disposition),
     but only n Answer Combinations.
In the example above with 3 players -
     3 white hats and 2 black hats were used,
     producing 7 possible Hat Dispositions but only 3 Answer Combinations.