That's A Big Number!

Logic Level 3

There is prison.

Imagine there are 100 prisoner in that prison including you.

One fine day the inspector comes and sets up a challenge for all of the 100 prisoner.

The challenge is that he will make you stand on a stair case which has 100 stairs.

Assume that you are on the 100th stair or the top most stair and the others are on the remaining stairs.

The inspector comes and put either a black or white hat on all of the prisoner. You have been told that there are only black and white hats but not told the number of black or white hats.

Then the inspector asks starting from you as your on the top that "What is the color of hat that your wearing?"You are either allowed to say black or white nothing else. Prisoners are not allowed to see there own hat nor they are allowed to see the hat of the prisoner behind him.

Each prisoner is only able to see the hats of the prisoners who are standing in front of him.

If your answer is correct then you are set free from the prison.But if your answer is wrong then you are killed.

Each prisoner is able to here the answer of all the other prisoner. All the prisoner including you are told about this challenge one day before. Thus you have to plan a strategy such that maximum of you all are set free and not killed.

So the question is "What is the maximum number of people you can save?"


The answer is 99.

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.

2 solutions

Lee Young Kyu
Aug 12, 2014

Only the one on the top will be killed(or he can stay alive if he is lucky). The strategy is The one on the top count the number of black hats. If its even, then the one on the topsays black, if its odd then says white. Then the rest will know wether number of black hats in the group of 99 people is odd or even,and they can count the number of blacks in front of them, thus they can confirm their hat color.

But if you don't know how many are black or white, how would counting the blacks in front of you help? The question says there are 100 hats, but not how many are each color.

Jason Suited - 6 years, 8 months ago

Log in to reply

lets say the one on the top(1st) says black, means the number of black hats in the 2nd~100th hats is an even number. Then the 2nd one can count the number of black hats in the 3rd~100th hats. If the number is odd, then he is wearing a black one (odd number black hats in front of him + the one he is wearing=even number of black hats, and that's what the first guy saw). if the number is even, then he is wearing a white one. And the same thing goes on and on and everyone except the first one is safe.

Lee Young Kyu - 6 years, 4 months ago
Lee Isaac
Jun 5, 2015

The english was quite bad, but that was a good question!

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...