Three prisoners see each other's hats, but not their own. The first one in line, who doesn't see any hats, is the one who finally answers.
The three prisoners and the red hats
Riddle statement
Three perfectly logical prisoners are lined up. Each one can see the hats of those in front of them, but not their own or those of those behind them.
The guard tells them that each hat is red or blue, and that at least one of them is red.
He asks them, starting with the last one in line, if they can deduce the color of their own hat. The last one answers no. The second also answers no. Then the first one deduces the color of his hat.
What color is his hat and how do he know it?
Show solution
Solution
Answer: his hat is red.
Let's call the prisoners, from back to front, A, B and C. A sees B and C's hats; B sees only C's; C doesn't see any.
A says he doesn't know. If he had seen two blue hats, he would have immediately concluded that his was red, since the guard guaranteed that at least one is. Since A does not know, B and C are not both wearing blue hats.
B hears this and looks at C's hat. If C were wearing blue, B would know that his is red, because it has just been ruled out that they are both blue. But B also says he doesn't know.
Therefore, C cannot wear blue.
C reasons all this without seeing any hat, and concludes that his is red.