# Prisoners and the poison

There was a brutal emperor in SamLand who was very fond of wine. Due to his brutality and arrogant nature, none of his troops even liked him. They eventually wanted to get rid of the emperor's autonomy. Thus they unanimously decided to kill the emperor. They planned to mix poison in all the 15 bottles of wine the emperor recently ordered. 5 of the troops were assigned that risky task to kill the emperor.

However, the queen loved the emperor a lot and she always supervised everything without letting others knew anything. She actually got the news of secret planning of murdering the emperor. She at once went there and caught all the 5 who were there to mix the poison.

All of the 5troopers were prisoned. Emperor got to know that only one of those 15 bottles is already poisoned. Now emperor thought that as a punishment he will use those 5 prisoners to taste those wines out of the bottle to figure out the poisoned bottle(if someone drinks the poisoned wine, dies at once). So that He can enjoy the other 14 bottles of wine with his queen.

But, the prisoners planned that they all 5 will not die all along. Rather they will come out with a plan so that the maximum of those 5 survives.

But the emperor forced all of them to taste the wines. So, all have to taste wines from bottles.

**N.B:** prisoners also don't have any idea which bottle is poisoned as they were there to mix randomly.

So our task is to

maximize the number of survival or minimum number of killingLet's order the bottles 1 to 15 and write their equivalent binary representation up to 5 bits

And number our five prisoners

5 4 3 2 1The prisoner drinks a bottle if the corresponding bit is one.

Like

bottle 1 - 00001thus it's tasted by one prisoner1bottle 2 - 00010thus it;s tasted by one prisoner2bottle 14- 01110thus it's tasted by prisoner2, 3, 4So all have different patterns and we can figure out seeing which prisoners die after tasting,

Like if only prisoner no.

1dies, thenbottle 1is poisoned.If prisoner no.

1, 2dies, thenbottle 3is poisoned.So on...

Thus what can be the case when maximum dies?

That is for

bottle 151,2,3,4dies5survivesSo, maximum 1 out of the 5 survives.Now the problem can be extended for any number of bottles, prisoners or there may be other modifications, but the basic idea still is the same.

need an explanation for this answer? contact us directly to get an explanation for this answer