Three men are sentenced to death, but the judge is in a playful mood.
The men are shown five hats - three black and two white. The men are blindfolded, each has a hat placed on his head, they are tied in position so they can't move, and the blindfolds are removed. The first man can see both others. The second can only see the third. And the third can't see either of the other men. The unused hats have been hidden.
They are told that if any of them can say what colour hat they are wearing, they can all go free. But one incorrect answer means they are all dead men.
The first man says that he does not know.
The second man says that he does not know either.
The third man says that he does know.
How does he know, and what colour is his hat?
If the first man could see two white hats he would know that he was wearing a black hat. As he does not know, he must be able to see one or two black hats.
If the second man could see a white hat he would know that the black hat visible to the first man must be on his head. As he does not know, he must be looking at a black hat.
So the third man is wearing a black hat.