Mar 13, 2011

King's Poisonous Wine II

Source: Puzzle Corner, Australian Mathematical Society

Problem: The king has 500 barrels of wine, but one of them is poisoned. Anyone drinking the poisoned wine will die within 12 hours. The king has four prisoners whom he is willing to sacrifice in order to find the poisoned barrel. Can this be done within 48 hours?

17 comments:

Not possible, the maximum number of barrels from which you can find out one poisonous barrel with four prisoners and four turns is 209.

This is actually a recursion, f( x, y ) = f(x, y - 1) + x * f(x -1, y - 1);where f (x , y) is the maximum number of barrels which can be filtered out with x prisoners at disposal, and y turns.

base case being f(x, 0) = f(0, y) = 1So, if there are 209 prisoners, I will give all the four prisoners 34, bottles each to drink. If one of them dies, I have to sort out the remaining 34 bottles with 3 prisoners, otherwise, 73 bottles with four prisoners in three turns, and so on...

I agree with tejas. But I think it should be (1+k)^n - 1 (Assuming that there are infinite barrels and the null case is not allowed). Let f(n,k) denotes the number of barrels that can be checked by n persons and k time slots. Basically the following recursion holds:

You split each barrel into how many ever prisoners you have. Now you carry out the tests on each prisoner independently.For one prisoner case, prisoner has to try one barrel at a time. So each barrel gets a tag "k" which means it is going to be tried in the k'th trial. So you can have a total of K+1 tags (K = total number of trials, tag=0 means barrel not tried at all).Now, each barrel is going to get independently tagged by N prisoners. Hence, you can have (K+1)^N unique tags.

We can also view it this way, any number from 1 to 500 (actually 1-625, or 0-624 doesn't matter) can be written down in base 5, with numbers 0,1,2,3,4. if a bottle number x is written as abcd, where a,b,c,d are between 0-4(natural numbers) then the bottle x will be given to prisoner 1 at ath trial prisoner 2 at bth trial and so on. Seeing the deaths of the prisoners, we can find a,b,c,d of the poisoned bottle and thus x, and thus we can find the poisoned bottle.

We can also view it this way, any number from 1 to 500 (actually 1-625 or 0-624 doesn't matter) can be written in base 5. If bottle number is x, it is written as abcd, where a,b,c,d are natural numbers from 0-4. Seeing the deaths of prisoners at various stages, we can find a,b,c,d of poisoned bottle and thus find x, ie the number of poisoned bottle.

I have a variation of this puzzle that I'm really struggling with, any ideas ?

King Petras is the ruler of a medieval empire. Tomorrow he will celebrate the marriage of his eldest daughter Ailín. One problem - the evil count Pierre Foutou has poisoned one of the barrels holding the wine that will accompany the feast. King Petras however has an unlimited supply of political prisoners who can "taste test" the wine for him.

The poison exhibits no symptoms until death. Death occurs within twenty four hours after consuming even the minutest amount of poison - there will be no chance for any prisoner to be "used" more than once.

What is the smallest number of prisoners required to drink from the barrels to be absolutely sure to find the poisoned barrel, for the following number of barrels?:

Problem: The king has 500 barrels of wine, but one of them is poisoned. Anyone drinking the poisoned wine will die between 23 and 24 hours. The king has 2 prisoners whom he is willing to sacrifice in order to find the poisoned barrel. All testing of the barrels must be complete within 12 hours of testing because you only have access to the barrel room for 12 hours. Can the poison be located at the end of a 48 hours?

Amazon.com Mathematics Bestsellers

Buy me Coffee / Beer via Paypal/BTC

Pages

Search This Blog

Follow by Email!

About Me

I am an early stage technology investor at Nexus Venture Partners. Prior to this, I was a 3x product entrepreneur. Prior to this, I worked as a private equity analyst at Blackstone and as a quant analyst at Morgan Stanley. I graduated from Department of Computer Science and Engineering of IIT Bombay. I enjoy Economics, Dramatics, Mathematics, Computer Science and Business.

Disclaimer

This is a personal blog. Any views or opinions represented in this blog are personal and belong solely to the blog owner and do not represent those of people, institutions or organizations that the owner may or may not be associated with in professional or personal capacity. Any views or opinions are not intended to malign any religion, ethnic group, club, organization, company, or individual.

All content provided on this blog is for informational purposes only. The owner of this blog makes no representations as to the accuracy or completeness of any information on this site or found by following any link on this site. The owner will not be liable for any errors or omissions in this information nor for the availability of this information. The owner will not be liable for any losses, injuries, or damages from the display or use of this information.