Hats or Death

Level 1

An executioner lines up 100 prisoners single file and puts a red or a blue hat on each prisoner's head. Every prisoner can see the hats of the people in front of him in the line - but not his own hat, nor those of anyone behind him. The executioner starts at the end (back) and asks the last prisoner the colour of his hat. He must answer "red" or "blue." If he answers correctly, he is allowed to live. If he gives the wrong answer, he is killed instantly and silently. (While everyone hears the answer, no one knows whether an answer was right.) Is it possible that at least 99 people survive?

Yes No

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

3 solutions

Mohammad Khaza
Jul 1, 2017

very nice logical question.

look carefully, Every prisoner can see the hats of the people in front of him in the line - but not his own hat,nor those of anyone behind him.

so, he/she can watch the persons hat in front of him.that's enough to save his life.but the last person has to face death.

dont you mean the first person?

NSCS 747 - 7 months, 4 weeks ago

They need to agree on that how the last person in the line is going to pass the information about the parity of the number of red or blue hats.

The last person in the row (who sees everyone else) says e.g. "red" if they see the even number of red hats and says blue if they see an uneven number of red hats in the front.

The next person knows if the number of red hats seen by the person behind them was even of not. If the number of red hats was even and the second-last person sees also an even number of red hats, they know that they have a blue hat on their head and they must say "blue". Otherwise they say "red". This is the information for the person ahead. In this way everyone apart from the last person knows the colour of their hat. The first (last in a line) person who guessed has 50% chance to guess correctly.

Abhra Gupta
Mar 9, 2020

One possible solution is that the Last person who can see all 99 Prisoners in front, observes all Hats are of the same colour. He can call out the colour. If he is also wearing the same colour, he is saved (Hence all 100) .

Else 99 are saved if they call out the same colour as the Last prisoner did. And the last prisoner was wearing a different colour.

If one of the 99 Prisoners have a hat of different colour, then it would have not been possible.

But as per the first scenario, it is possible that at least 99 people survive

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...