Mr Wright remembers this problem from when he was your age – so it must be at least 15 years old. Don’t me put off by the length of the instructions, the problem is not hard to understand … but takes a while to work out

Four criminals are caught and pleaded to the judge to release them without any punishment. As it was a minor offence, the judge told them that they will be freed without punishment, but only if they can solve a puzzle.
All four of them are lined up on some steps (as shown in the picture above). A wall separates the 4th person from other three.
Criminal 1 can see 2 and 3
Criminal 2 can see 3
Criminal 3 and 4 can’t see any one else
Criminals are wearing hats, they are told that there are two white hats and two black hats. They can’t see their own hat colour and are told to shout their hat colour as soon as they get to know for certain what colour it is.
They are not allowed to turn around or move.
They are not allowed to talk to each other.
They are not allowed to take their hat off.
If a criminal shouts out the colour of their hat correctly – they are released. One wrong answer and they go to prison, so none of them want to guess.