Now this problem is a bit tricky. Before you start panicking about the solution let us give you a hint. You need to think in terms of binary numbers.
There are 1000 bottles which should be labeled from 1 to 1000 first. Now write those numbers in binary format.
Bottle Number 1 = 0000000001
Bottle number 2 = 0000000010
Bottle number 500 = 0111110100
Bottle number 1000 = 1111101000
Now the king will summon ten prisoners and label them from 1 to 10. The prisoner labeled as 1 will take a sip from those bottles that have a 1 in its least significant bit and the prisoner labeled as 10 will take a sip from every bottle that have a 1 in its most significant bit etcetera.
Let us frame an example. The wine from the bottle number 924 will be sipped by 10, 9, 8, 5, 4 and 3. Thus if that bottle will be poisoned, only those 6 prisoners will die.
After a month's time, all the king need to do is line up the prisoners in order and call each living prisoner as 0 and each dead prisoner as 1. N such a manner the number that the king will get will be of that bottle which is poisoned.
Now also note that if there would have been 1024 or more bottles, there would have been more prisoners required for the very same task.
There are 1000 bottles which should be labeled from 1 to 1000 first. Now write those numbers in binary format.
Bottle Number 1 = 0000000001
Bottle number 2 = 0000000010
Bottle number 500 = 0111110100
Bottle number 1000 = 1111101000
Now the king will summon ten prisoners and label them from 1 to 10. The prisoner labeled as 1 will take a sip from those bottles that have a 1 in its least significant bit and the prisoner labeled as 10 will take a sip from every bottle that have a 1 in its most significant bit etcetera.
Let us frame an example. The wine from the bottle number 924 will be sipped by 10, 9, 8, 5, 4 and 3. Thus if that bottle will be poisoned, only those 6 prisoners will die.
After a month's time, all the king need to do is line up the prisoners in order and call each living prisoner as 0 and each dead prisoner as 1. N such a manner the number that the king will get will be of that bottle which is poisoned.
Now also note that if there would have been 1024 or more bottles, there would have been more prisoners required for the very same task.
No comments:
Post a Comment