A bad king has a cellar of 1000 bottles of delightful and very expensive wine. A neighbouring queen plots to kill the bad king and sends a servant to poison the wine. Fortunately (or say unfortunately) the bad king’s guards catch the servant after he has only poisoned one bottle. Alas, the guards don’t know which bottle but know that the poison is so strong that even if diluted 100,000 times it would still kill the king. Furthermore, it takes around a month to have an effect. The bad king decides he will buy some slaves to drink the wine. Being a clever bad king he knows he need only buy 10 slaves and will still be able to drink the rest of the wine (999 bottles) at his anniversary party in 5 weeks time. Explain what is in the mind of the king, how will he be able to do so ?
If there wasn’t any time constraint in the problem, we could have had simpler solutions with less mortality. If he has, say n prisoners (n<1000) then he can divide wine bottles in a [1000/n] set. Every month he can take one set of bottles, and he can administer each wine bottle uniquely to each prisoner and then wait for a month and repeat the process with next set of bottles until he finds the poisoned bottle. Another solution could be to divide 1000 in set of two groups. Take one group and take a small portion from each bottle and mix then, and feed it to a prisoner. If the prisoner dies, divide the used 500 bottles and repeat the process until he finds the poisoned bottle. 500–250–125–63-31-16-8–4–2–1
Here odd numbers can’t be divided and would result in uneven distribution but still the number of prisoner king would need is 10, to have a 100% probability of knowing which wine was poisoned.
So now we will come back to the original puzzle with the given time constraint that the solution is needed within 5 weeks. So, what bad king had in his mind was binary numbers. As we know binary is number to the base 2 having only two digits 0 and 1
To begin, the king would label each bottle with both its decimal number and a 10-digit binary equivalent. Why 10? coz 2^9=512 < 100 0 bottles of wine < 2^10.
Now, the king can code the 10 prisoners from P1 to P10 in the following arrangement.
Now each bottle serves as a code describing which prisoners are to drink from it. In this system, a one means the prisoner drinks from it, a zero means the prisoner doesn’t.
For example, only Prisoner A10 should drink from bottle one since its binary is 0000000001. Whereas, Prisoners A9 and A10 should drink from bottle no 3 whose binary is 0000000011 because it has 1’s in the columns that match up with prisoners A9 and A10.
The king will continue this process until he has given out sips of wine from every bottle. Since, each bottle is a unique placement of 0 and 1’s so the poisoned bottle will result in the death of specific prisoners. Say for example the poisoned bottle it 662 then its binary equivalent is
1010010110 So in this case, prisoners A1, A3, A6, A8 and A9 will die while others would survive. So, after a month, he can simply line up the prisoners in order and mark the ones have been poisoned with ones and mark the rest with zeros. Then all he needs to do is to convert the resulting binary number back into its decimal equivalent to reveal which bottle was poisoned.