You got 100 bottles of wine and only one is poisoned: you want to know which one is. You can make rats drink the wine of the different bottles (they can test one or several bottles each). You only know if they are alive or dead the next day and you want your answer the next day (so you can’t test one rat after the other). How many rats at least do you need to find out which bottle is poisoned ? (Look for the smallest number of rats)
Hint: search the problem at first with 7 bottles
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Number the 100 bottles of wine from 0 to 99 and then convert them to base 2 that is from 0 2 to 1 1 0 0 0 1 1 2 . There is a total of 7 binary digits. Now use 7 rats to represent the 7 2 n -digit d n , where n = 0 , 1 , 2 , 3 , 4 , 5 , 6 . The d n rat is to drink from the bottle with d n = 1 . Since each of the 100 bottles has a unique 7-digit binary code, The poisoned bottle will kill the specific digital rats. For example, if none of the 7 rats dies, then bottle 0 is poisonous. If d 0 , d 1 and d 2 rats die, then bottle 7 ( 1 1 1 2 ) is poisonous. Therefore, we need only 7 rats of which at most 6 will be killed.
Decimal 0 1 2 ⋯ 9 7 9 8 9 9 d 6 0 0 0 ⋅ 1 1 1 d 5 0 0 0 ⋅ 1 1 1 d 4 0 0 0 ⋅ 0 0 0 d 3 0 0 0 ⋅ 0 0 0 d 2 0 0 0 ⋅ 0 0 0 d 1 0 0 1 ⋅ 0 1 1 d 0 0 1 0 ⋅ 1 0 1
Problem Loading...
Note Loading...
Set Loading...
I give the answer for 7 bottles, it’s the same for 100. Let’s number the bottles in binary from 0 to 6 :
0<->000
1<->001
2<->010
3<->011
4<->100
5<->101
6<->110
We then need 3 rats Why? Each rats tests the bottles where there is a « 1 » in the k position for k in {1,2,3}. Then if the first rat dies the poisoned bottles is necessarily the number 4 (always starting from 0). You have then 7 different cases whether it’s only the rat 1,2 or 3 who dies or it’s both rats 1 and 3 or 1 and 2 or 2 and 3 or 1 and 2 and 3 who die. Same logic for 100 which is 1100100 in binary