4 men are buried up to their necks in the ground. They can only look forward. Between A and B is a brick wall they cannot see over.
They all know that between them they are wearing 4 hats, 2 black and 2 white, but they do not know what one they are wearing.
In order to avoid being shot one of them must call out to the executioner the colour of their hat. If they get it wrong, everyone will be shot.
They are not allowed to talk to each other and have 5 minutes to work it out.
After 4 minutes, one of them calls out, virtually certain of the colour of his hat – how did he know. There are no tricks.