Problem
Three
 super spies are caught sending sensitive information to an enemy state.
 These three double agents are apprehended and taken out to a remote 
spot in the woods. They are told that one of them will be part of a 
prisoner exchange, and the other two will be executed.
 To
 decide who lives, the guards decide to play a game. They show the 
captives eight stamps: four red, and four green. They then blindfold the
 three men and stick two stamps to each of their foreheads. One of the 
guards puts the remaining two stamps in his pocket.
To
 decide who lives, the guards decide to play a game. They show the 
captives eight stamps: four red, and four green. They then blindfold the
 three men and stick two stamps to each of their foreheads. One of the 
guards puts the remaining two stamps in his pocket.
The
 guards then take the blindfolds off the captives, who can each see the 
stamps on the other two men's heads, but not the two stamps on their own
 head, and not the two stamps in the guard's pocket. These spies are 
highly intelligent—they're perfect logicians who know they can count on 
each other to correctly and quickly interpret the information they have.
The
 guard captain tells them that the first man to figure out the color of 
the stamps on his own head will be used for the prisoner exchange, and 
the other two will be executed. If anyone guesses wrong, they will be 
shot dead on the spot.
The captain then asks the spies in order if they know what color stamps they have on their head. The answers are as follows:
- A: "No."
- B: "No."
- C: "No."
- A: "No."
- B: "Yes."
Spy B answers correctly. What color are the stamps on his head, and how does he know?
 
