TITLE: A logic problem. No need for calculation
QUESTION [14 upvotes]: Three people were told to go to a cave and each pick up a hat in pitch dark. The three then came out of the cave with the hat on their heads. There were five hats in the cave. Three of them are black, the rest is white. When the first one is asked to tell the color of his hat, he said that he doesn't know. The second person told then same. But the third person said he knows. Why does he know the color of his hat based on what he heard from the other two persons? And how?

REPLY [2 votes]: If first person saw the two others wearing white hats, he would know that he must wear a black hat, and would have said "black". Since he said he doesn't know, at least one of the other two must wear a black hat.
The second person can look at the third. If the third is white, he knows that he himself is black (based on the first guy's answer), and must answer "black". Since he says he doesn't know, the third person must be wearing a black hat.