Hats, caps and cards

The first time I read this puzzle was in Willy Hochkeppels “Denken als spel”, somewhere in my youth.

1) The puzzle is simple: A geek kind of sultan had 3 prisoners. He showed them 5 hats: 3 black, 2 white. He blindfolded them, and then put a black hat on each of their heads. He took off their blindfolds. None could see the hat on his own head, and they were not allowed to take it off. Each could however see the hats on the heads of their fellow prisoners.
“If you can tell me what head is on your own head”, he told them, you are free.
The prisoners looked at each other for considerable time. Then they declared together: we all have a black hat.

Solution: nr 1

The puzzle can be told in several settings. Sometimes people are prisoners of a Japanese officer in WW 2, or they are volunteers searching the hand of the daughter of the sultan.

Yesterday a fellow worker, Jon Koeter, told me a similar puzzle:
Four people are shown 2 square hats and 2 triangular hats. One is positioned at one side of a wall, the other three are queued at the other side. They are all facing the wall. Each one can only see the people and hats in front of them – they are not allowed to look behind them or look what hat they have themselves. They are told that the game will stop when one one of them knows the answer – they can hear each other, but are not allowed to talk about their hats.

Still, after a while, one of them says: I know what hat I have.
How does he know?

Solution: Nr 11

3) This puzzle has been made into a game by famous game inventor Robert Abbott, using ordinary playing cards. Each player gets a cap which can hold three cards. The players each get three card stuck on their cap which all fellow players can see, but no one can see his/her own cards. Players may ask each other Y/N questions, such as : do you see 3 jacks? Or: do you see 2 clubs? Is the sum of the numbers you see greater than 15? The first person to know the cards on his own cap wins.