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 are 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 explains the game to the prisoners.

Details of the Game: 4 prisoners and hats logic puzzle

  1. Out of 7 hats, 3 were black and 4 white. A hat is placed on the head of each.
  2. Starting from the back, each prisoner will be asked the question, “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 speaks, “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 good news is: The shortest prisoner, the fourth in the queue from back, 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 4 prisoners and hats logic puzzle by implication analysis and reasoning

Think the way the logician prisoners thought. At each step with each answer, ALL PRISONERS YET TO BE QUESTIONED must deduce the IMPLICATION OF ALL earlier 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 logic 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 3 black hats and 4 white hats are there.

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. Here, the hats left would have been just 4 white ones. His hat color would surely be white.

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 to deduce implications of his silence.

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

He could see two hats in front. He 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 must have been 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 to deduce implication of his silence.

Implication of the SILENCE of the third prisoner from the back: 4 prisoners and hats logic 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 consequent implications.

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

It didn’t happen that way.

The third prisoner from the back couldn’t be sure of the color of his own hat, because the hat he saw just in front was white.

When he remained silent, the prisoner at the front also knew what the prisoner behind him saw.

This is the way the fourth prisoner from back 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.

Bonus puzzle

Still interested? Okay, we’ll leave a small piece of food for thought for you.

What will 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 create your own variation and solve it.

Will you?


Do you want to know how to solve difficult problems easily without wasting time on random attempts?

Our new ebook on puzzle solutions by innovative methods will show you just that.

Puzzles for Adults eBook

Puzzles for Adults: 50 Brain Teasers with Step-by-Step Solutions: Boost Your Power of Problem Solving

(Universal link for Apple books, Barnes & Noble, Rokuten Kobo, Vivlio, Angus & Robertson, Tolino, PayHip and others)

You will enjoy solving its 50 challenging brain teasers and at the same time boost your power of problem solving from the innovative step by step solutions rich with new ideas.

The general problem solving techniques are collected first time in a separate chapter.

It's not just solving puzzles. It is also learning innovative problem solving techniques that will change the way you try to solve ANY problem.

You may buy the eBook at Amazon or at Google Play.


Puzzles you may enjoy

Easy to hard brain teasers with systematic solutions

Challenging brain teasers with solutions: Long list.

This will always be the most up-to-date full list with the brain teasers classified into categories that can be browsed separately.

You may also click on the category term link below to enjoy the brain teasers that are classified in the present category.

For example, if the category term link shown below is "Riddle", click on it to go through all the Riddles.