A King has a collection of 1000 bottles of irresistible and one of the finest wines in the world. The king is quite fond of drinking which is taken to be as a weak point by the neighboring king, He creates a plan to kill the king so that he can take over his kingdom and increase his power. He send in a servant to poison the wines with a deadly virus that is so strong that even if it is diluted a million times, it will still have an effect and will kill the king over a prolonged duration of one month.
The servant is able to mix poison in only one of the wines when the guards catch him. The servant is killed and thus the truth behind which of the 1000 bottles is poisoned dies with him. The king call up his advisor who is quite clever. He tells the king something which brightens up his face. He summons some of his prisoners. Seeking what the advisor told him, he knows that he will not have to murder more than ten prisoners and he will be able to enjoy the rest of the 999 bottles of wine after a month's time.
What trick did the advisor tell the king? How will the king be able to achieve what he thinks?
Solution:
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.