This article is from the Puzzles FAQ, by Chris Cole firstname.lastname@example.org and Matthew Daly email@example.com with numerous contributions by others.
Three logicians, A, B, and C, are wearing hats, which they know are either
black or white but not all white. A can see the hats of B and C; B can see
the hats of A and C; C is blind. Each is asked in turn if they know the color
of their own hat. The answers are:
What color is C's hat and how does she know?
A must see at least one black hat, or she would know that her hat is black
since they are not all white. B also must see at least one black hat, and
further, that hat had to be on C, otherwise she would know that her
hat was black (since she knows A saw at least one black hat). So C knows
that her hat is black, without even seeing the others' hats.