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 ?
We have already discussed one method to solve the puzzle, now we will consider another method which in a way is similar to the previous one in theory but different in application.
Firstly, the king would label the bottles from 0 to 999. And then he would line up the 10 prisoners and lable them as A1, A2 and so forth.
Bottle 0
Bottle 1
Bottle 2
..
The king will have Prisoner A1 drink from every other bottle starting with the first bottle, bottle #0 that is Prisoner A1 will drink from bottles 0, 2, 4, …
Next, assign Prisoner A2 the task of drinking from every other set of two bottles. In other words, Prisoner B drinks from bottles 0 and 1, skips 2 and 3. Drinks from 4 and 5, skips 6 and 7, and so forth continuing the pattern.
Have Prisoner A3 drink from every other set of four bottles: for example Prisoner C drinks from bottles 0–3, (skip 4–7), 8–11, (skip 12–15), 16–19, …
If we look at the pattern then the bottle assignments reflect powers of 2. So if we continue with the assignment then
PrisonerA4 drinks from every other set of eight bottles. Prisoner A5 from every other set of 16. Prisoner A6 from every other 32. Prisoner A7 from every other 64. Prisoner A8 from every other 128. Prisoner A9 from every other 256. And finally, Prisoner A10 from the first 512 bottles.
Now, How the king will be able to tell which bottle was the poisonous one? To do so he will look at the pattern of poisoned prisoners encoded in binary sequence. Before he can decode the result, he needs to flip the prisoners around so that it matches the binary place-value system. He would place a zero above the prisoners who are poisoned, and a one above those who aren’t.
Now suppose all the prisoners are poisoned? Which bottle of wine was it?
Now let’s suppose that everyone except prisoner A is poisoned.
How about if A1, A4, A6, A7 and A9 are poisoned then
1010010110
Which is the binary equivalent of bottle number 662.