Posts

Showing posts with the label prisoner

The Green-Eyed Logic Puzzle

In the green-eyed logic puzzle, there is an island of 100 perfectly logical prisoners who have green eyes—but they don't know that. They have been trapped on the island since birth, have never seen a mirror, and have never discussed their eye color.

On the island, green-eyed people are allowed to leave, but only if they go alone, at night, to a guard booth, where the guard will examine eye color and either let the person go (green eyes) or throw them in the volcano (non-green eyes). The people don't know their own eye color; they can never discuss or learn their own eye color; they can only leave at night; and they are given only a single hint when someone from the outside visits the island. That's a tough life!

One day, a visitor comes to the island. The visitor tells the prisoners: "At least one of you has green eyes." 

On the 100th morning after, all the prisoners are gone, all having asked to leave on the night before. 

The Green-Eyed Logic Puzzle

How did they figure it out?


Here is the solution! 

The Green-Eyed Puzzle Solution


Here is that Puzzle! 

Nobody is going to dare to go the guard unless he is absolutely sure that he is green eyed; otherwise it would be suicidal move.

-------------------------------------------------------------------------------------
 
For a moment, let's assume there are only 2 prisoners named A & B trapped on island.

On first day, A is watching green eyed B & B can see green-eyed A. But both are not sure what is color of their own eyes. Instead, A(or B) waited B(or A) to escape from island since he is green-eyed. Rather both are sure that other too doesn't know anything about color of own eyes.

On next morning both see each other still on island. Here is what A thinks.


If I was non green-eyed then B would have realized that the person pointed by visitor in his statement ('at least one of you have green eyes') is himself. Hence, B would have realized that he is green-eyed & could have escaped easily. Since B didn't try to escape that means I too must have green eyes.

So A can conclude that he too have green eyes. Exactly same way, B concludes that he too has green eyes. Hence, on next day both can escape from the island.
 

Note that, if the night of the day on which visitor made statement is counted then next day would have 1st morning & 2nd night since visitor's visit. Now since A & B left on 2nd night, we can't see anybody on 2nd morning next day.

--------------------------------------------------------------------------------
 
Now let's assume there are 3 prisoners named A,B and C trapped on island.

Let's think from A's point of view as an example.What he thinks.

Let me assume I don't have green eyes.Now each B and C could see 1 green-eyed & other non green-eyed person. But still they don't know color of own eyes.So on that night nobody tries to escape.

On first morning I see both B and C still present there.

Now B can think that if he has no green eyes then C could have concluded that the person pointed by visitor's statement ('at least one of you have green eyes') is C himself (as both A & B are non green-eyed. This way, C would have realized that he is green-eyed.

In a very similar way, B would have realized that he too is green-eyed.

Now both of them could have escaped on that night as they are sure that they are green-eyed.

But on the second morning, I see again both of them are still there. So now I can conclude that I too have green eyes.


If A can conclude then why can't B and C?  So after seeing each other on 3rd day, each of 3 can conclude color of eyes is green. Now on 3rd night they all can escape safely.

This is called as inductive logic.

-------------------------------------------------------------------------------

If observed carefully, 2 prisoners need 2 nights and 3 prisoners need 3 nights to logically deduce that the each of them is green-eyed.

Hence, 100 prisoners would require 100 nights to absolutely make sure that each of them is green eyed.

That's why on the 100th morning day, there is no prisoner present on island. 


The Green-Eyed Puzzle Solution


Test Of Poison

You are the ruler of a medieval empire and you are about to have a celebration tomorrow. The celebration is the most important party you have ever hosted. You've got 1000 bottles of wine you were planning to open for the celebration, but you find out that one of them is poisoned.

The poison exhibits no symptoms until death. Death occurs within ten to twenty hours after consuming even the minutest amount of poison.

You have over a thousand slaves at your disposal and just under 24 hours to determine which single bottle is poisoned.

You have a handful of prisoners about to be executed, and it would mar your celebration to have anyone else killed.

What is the smallest number of prisoners you must have to drink from the bottles to be absolutely sure to find the poisoned bottle within 24 hours? 


Detecting the poisonous bottle

Here is the test designed for it! 

Source 


Test To Detect The Poison


Here is the challenge for us! 

Here binary number system can come to rescue. Just for a  moment, let's assume there are 15 bottles. Now let's number the bottles from 1 to 15. To test these 15 bottles we need 4 prisoners as below. Let's number the prisoners from in descending 4 to 1.

Detection of poisonous bottle

Wherever 1 is written for the particular bottle number, that bottle should be given to particular prisoner. Otherwise should not.

So for the specific bottle with unique number a specific combination of prisoners (they are bits here) would be formed. 


For example, if bottle labeled as 11 has a poison then prisoner no. 4,2,1 would die. In other words, if prisoner 4 & 2 die then the bottle no. 10 had poison.

For 16th bottle we would have needed 1 more prisoner.

In similar way, to test 1000 bottles, we need 10 prisoners (2^10=1024). Depending on what combination of prisoner die we can determine which bottle had poison. If prisoners numbered from 10 to 1 & if prisoner 10,8,6,3 & 2 die then bottle no.678 (binary -
1010100110) must had poison. Since the poison takes some time to take effect, even if prisoners taste this bottle, we still would have time to test rest of all bottles in given binary pattern. 

  Poisonous Bottle

In case there were 1025 bottle, we would have needed 11 prisoners.

 
Follow me on Blogarama