Thursday, February 5, 2009

An interesting puzzle

An evil king has 1000 bottles of wine. A neighboring queen plots to kill the bad king, and sends a servant to poison the wine. The king's guards catch the servant after he has only poisoned one bottle. The guards don't know which bottle was poisoned, but they do know that the poison is so potent that even if it was diluted 1,000,000 times, it would still be fatal. Furthermore, the effects of the poison take one month to surface. The king decides he will get some of his prisoners in his vast dungeons to drink the wine. Rather than using 1000 prisoners each assigned to a particular bottle, this king knows that he needs to murder no more than 10 prisoners to figure out what bottle is poisoned, and will still be able to drink the rest of the wine in 5 weeks time. How does he pull this off ??



I will post the solution in my next post ..








2 comments:

sYzYgY said...

i am aware of this puzzle. Is there any link with error correcting codes.Would like to figure out the solution for k poisonous bottles out of n bottles.. any thoughts?

CraZyPhoNon said...

2^10 = 1024.

You can number each of the bottles and get a binary representation of them. Assign bit position to each prisoner. Give wine from each bottle to the prisoner which has a bit set for the given no. The prisoners that die at the end of a month will give you the exact no for the bottle.