You are here

4 Prisoners and Hats Puzzle

4 Prisoners and Hats Puzzle

The prisoners and hats puzzle tests your logical thinking

4 Prisoners and Hats Puzzle: Alien chief offered a game of freedom or death to his 4 prisoners. Each will wear a hat and guess its color. Can anyone win?

The logic puzzle

Aliens have captured 4 humans all of whom happens to be logicians. One day in a playful mood, the Alien Chief offers a way of freedom to the prisoners through a game.

The prisoners are lined up in a queue so that the tallest in the back can see the heads of all others in front and the same for the others. Naturally, the shortest prisoner is placed right in the front.

The prisoners are now blindfolded and a hat is placed on the head of each.

Preparation for the test being over, blindfolds are removed and the Chief tells the prisoners about the game.

Details of the Game: 4 prisoners and hats puzzle

  1. Out of a total 7 hats, 3 black and 4 white, one hat is placed on the head of each.
  2. Each prisoners will be asked a question starting from the back, "What is the color of your hat?".
  3. The prisoner has two options: either to tell the color of his hat, or stay silent. If the answer is correct, the prisoner will be set free, but if wrong he will die. 
  4. If a prisoner is silent, he won't die or earn his freedom either. Same question will be asked to the next one in the queue and the game will continue.
  5. Every prisoner must not look behind and must not pass any kind of hint to the others except say the valid allowed answers which all can hear.

The Alien Chief finally rubs his tentacles and says, "Any questions?" All were silent.

"Okay, let's start the game." The alien Chief ambles towards the prisoner at the back, the first one in the queue, and asks his first question.

Result of test

The happy news is: The shortest prisoner, the fourth in the queue, could correctly tell the color of his hat and got his freedom after the first three remained silent.

Can you say what has been the color of the hat of the prisoner who earned his freedom? And why do you think it is so?

Time for you solve the riddle:  10 minutes.

Solution to the 4 prisoners and hats puzzle by implication analysis and reasoning

Think like the logician prisoners. At each step with each answer, ALL PRISONERS YET TO BE QUESTIONED must deduce the IMPLICATION OF ALL PREVIOUS ANSWERS.

Okay, that being clear, can you say what is the implication of the first response of silence?

Implication of the SILENCE of the first prisoner at the back: 4 prisoners and hats puzzle

He could see all three hats in front of him and couldn't be sure of the color of his own hat. He knew that there are 3 black hats and 4 white hats.

LOGIC 1: If any of three prisoners in front had a single white hat, it implies, number of black hats worn by the other two can at most be 2, and so hats left might well be 1 black and 3 white. His own hat could be ANY OF THE TWO COLORS.

On the other hand, he would have surely known the color of his own hat and earned his freedom only if all three hats in front were black. In this case, the hats left would have been exactly 4 white ones. His hat color would surely be white.

As it happened the prisoner at the back couldn't respond simply because ALL THE HATS IN FRONT WERE NOT BLACK, AT LEAST ONE WAS WHITE.

Let's move on to the second prisoner from the back.

Implication of the SILENCE of the second prisoner from the back: 4 prisoners and hats puzzle

He could see two hats in front and also knew from the answer of the first prisoner that at least one of the three hats including his own must be white.

LOGIC 2: If the second prisoner saw two hats in front were black, he would have been sure that the single white hat SEEN BY THE FIRST PRISONER AT THE BACK MIUST BE ON HIS OWN HEAD.

And he would have earned his freedom.

In reality, it was not so.

That means, ONE OF THE TWO HATS IN FRONT OF THE SECOND PRISONER FROM THE BACK MUST HAVE BEEN WHITE.

Let's move on to the next prisoner who stood third from the back.

Implication of the SILENCE of the third prisoner from the back: 4 prisoners and hats puzzle

He could see only one head in front but knew that both of his fellow prisoners couldn't be sure of the color of their own hats and the implications.

LOGIC 3: If he could see a black hat in front, he would have been sure that his own hat is white simply because the man behind him had seen at least one white hat in front, remember?

And he would have been the happiest person in the whole prison to earn his freedom at that moment.

But it didn't happen that way. The third prisoner from the back couldn't be sure of the color of his own hat, simply because THE HAT HE SAW IN FRONT WAS WHITE.

We know at this point why and how the fourth prisoner could earn his freedom. By the implications of the answers of the first three prisoners behind him, he knew that his own hat must be white.

Still not exhausted? Okay, we'll leave a small piece of food for thought for you.

What would be the color of hats of the third and the fourth prisoner from back if both of them answered correctly?

End note

Prisoners and hats puzzle is a classic logic puzzle that appears in more than one variation. You can form your own variation and solve it.

Can you?


Puzzles you may enjoy

Riddles

Two jugs riddle

The tramcar reunion riddle

Riddle of 4 persons crossing a bridge over a river at night

Three boxes riddle

Riddle of PROBLEMSOLVING - Creation and application of Repetition pattern based technique

Airplane riddle of flying around the world

Riddle of lying and truth-telling twins

Two jugs riddle of delivering 1 quart of milk each

How could Sonia sell half a poodle riddle

Transfer a pile of 15 numbered discs riddle

Mathematical puzzles

Reverse cheque puzzle

Reverse cheque puzzle solution

Counting eggs puzzles based on Euclid's division lemma

Monkey and the coconuts puzzle with solutions

10 digit Conway number puzzle with solution

World's Hardest Easy Geometry Puzzle Solved with Techniques Explained Step by Step

Hard Algebra Puzzles Solved by Basic Exponent Concepts and Reasoning

Three squares in a triangle puzzle

3 digit number math puzzle

9 squares in a rectangle math puzzle

How many addition signs needed to make sum of 99

Solve 3 puzzles by solving only one: Domain mapping

Logic analysis puzzles

Method based solution to Einstein's logic analysis puzzle, whose fish

How to solve Einstein's puzzle whose fish confidently, improved method based solution

Logic puzzle, When is Cheryl's birthday

Liar and truth-teller riddle with step by step easy solution

4 Prisoners and Hats Puzzle

Liar, Truth-teller, Random-answerer riddle

River crossing puzzles

Farmer with fox, goose and bag of corn crossing the river puzzle

Two pigs and two hens crossing river puzzle

3 monkeys and 3 humans crossing river puzzle

King queen minister washerman river crossing puzzle

Ball weighing puzzles

Find the heavier among 8 identical balls in 2 weighing puzzle

Find the fake ball among 8 identical balls in 3 weighing puzzle

Find the fake ball among 9 identical balls in 3 weighing puzzle

Find the fake ball among 12 identical balls in 3 weighing hard puzzle with solution

Matchstick puzzles

Solution to 6 triangles to 5 triangles in 2 moves, first matchstick puzzle

Matchstick puzzle 5 squares to 4 squares in 2 moves

Matchstick puzzle 5 squares to 4 squares in 3 moves

Matchstick puzzle, Turn around the fish in 3 moves

Fifth Matchstick puzzle, Move 3 sticks in tic-tac-toe figure to form 3 perfect squares

Hexagonal wheel to 3 triangles by removing 4 sticks

Convert 5 squares to 4 squares in 3 stick moves, third 5 square matchstick puzzle

Matchstick Puzzle - Make the kite nose-dive in 5 stick moves

Make 5 squares from 6 in 2 stick moves - 6 square matchstick puzzle

Move 3 sticks and convert 5 squares to 4 squares in 4th 5 square matchstick puzzle

Move 3 sticks and convert 4 squares to 3 squares matchstick puzzle

Move 8 sticks and convert 5 squares to 2 squares matchstick puzzle

First Move 3 sticks and make 2 squares matchstick puzzle

Second Move 3 sticks and make 2 squares matchstick puzzle

Remove 3 matchsticks to leave 6 triangles puzzle

Add 3 matchsticks to make 4 triangles - lateral thinking stick puzzle

Move 1 stick to make 4 closed shapes each with 3 or 4 sides

Move 2 sticks to make 5 closed shapes matchstick puzzle

Move 2 to make 7 squares matchstick puzzle - solution based on problem solving and innovation model

Move 4 to turn the tower upside down Matchstick puzzle

Move 2 matches to make 6 squares and move 8 matches to make 6 squares - a pair of matchstick puzzles

Move 3 matches to take the cherry out of wine glass and move 2 matches to take the cherry out - a pair of matchstick puzzles

Move 6 matches to make 5 squares

Move 2 matches and add 1 to make 2 diamonds puzzle

Move 4 matches to make 5 triangles matchstick puzzle

Remove 4 matches to leave 4 equal triangles puzzle

Transfer 1 match in two matchstick groups puzzle

Move 3 matches to make 5 equal squares puzzle