Fog Creek Software
Discussion Board

bad king


Suppose you and your beloved wife are chosen to be two of the prisioners to be poisoned  in order to save the bad and clever king.
But you have a single chance to propose another strategy  and this is the very only chance you need to save you and your soulmate. If you convince the king it will work out without sacrificing you and your wife, he will even let you free!
All the other constraints are the same. What would you propose? "Tips": the method I have in mind is not inherently different, and is coupled with details of the problem statement.
The answer comes in a few days, or just after you answer it!

Wednesday, April 10, 2002

If we assume that the poison strictly takes exactly 31 days to have its effect and king's party is in 35 days then we can do it.
On the first day, the king's makes the 8 prisoners drink from the first 256 bottles in the same way as described in the solution. On the next day he makes them drink from the next 256 bottles and so on till the fourth day. If anyone dies on the 32nd day, then the posion is in the first 256 bottles and he can decode the bottle number by the status of the 8 prisoners. Similarly he can do it for 33rd, 34th and 35th days. On the 35th day, he will know the poisoned bottle.

vivek gupta
Friday, April 12, 2002

Yeah Mr. Gupta! That's what I was also assuming... Your soulmate would be proud of you ;-)

Friday, April 12, 2002

*  Recent Topics

*  Fog Creek Home