Four prisoners are given a puzzle by a jailer to determine their fate - they are each given a hat that is either black or white but can only see the hats of others, not their own. If any prisoner can correctly guess the color of their own hat, all four will go free. The third prisoner is able to deduce the color of his hat and correctly shouts it out, solving the puzzle and freeing them all.