31 Oct 2013

King and Wine Bottles

Puzzle Problem: 

A king has a stock of 1000 bottles of delightful and very expensive wine. A neighboring queen plots to kill the bad king and sends a servant to poison the wine. Fortunately the king’s guards catch the servant after he has only poisoned one bottle. Now the kind needs to find the poisoned bottle as he cant discard all bottles as they are very expensive and imported. Furthermore, it takes one month to have an effect of the poison. The king decides he will get some of the prisoners in his vast dungeons to drink the wine. Being a clever king he knows he needs to murder no more than 10 prisoners – believing he can fob off such a low death rate – 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 mind of the king, how will he be able to do so ?

Hint : Think in terms of binary numbers.

Answer:

-
Bottles will be represented in terms of binary numbers :


BOTTLE
Decimal
Binary
5
101
23
10111
100
1100100
255
11111111
511
111111111
682
1010101010

 10 prisoners will be selected to find out the poisoned bottle
 Each prisoner will be assigned to corresponding to a bit in the Binary Represention.

For e.g. Bottle ,  numbered as 682 will be sipped by



Decimal
Binary
Number
682
1
0
1
0
1
0
1
0
1
0
Prisoners
10
9
8
7
6
5
4
3
2
1


As we can see if the bottle number 682 was poisoned then the prisons 10, 8 , 6 , 4 , 2 would die.
-

No comments:

Post a Comment