Question: There are n bottles of water, one of which is highly toxic. If the mouse drinks it, it will die 24 hours later.
Q: How many mice can detect which bottle of water is highly toxic?
Requirement: the number of mice used is small and the time should be short, and a reasonable process and conclusion should be given.
My solutions are as follows:
This is a binary switch (0/1) Problem, similar to the Haiming code Verification AlgorithmThe potion is numbered in binary format (0000010,000,...), and the minimum number of BITs can be fully numbered;
Then, select the mouse according to the binary number, map the mouse to the corresponding binary number, and traverse the same bits of different mice in sequence. If this bid is 1, drink a bit of the potion from this bottle, if this parameter is set to 0, do not drink it. (As for how to drink it, you can first mix the potion by bit and put it in other bottles, then let the mouse drink the mixed potion. Of course, the quantity of mixed potion is the same as that of the selected mouse );
Finally, through the mouse's life and death to identify which bottle of potion is highly toxic.
Analogy instance analysis:
1) Suppose there are 6 bottles of potion, one of which is highly toxic and others are non-toxic.
2) by calculating 2 ^ 3 = 8> = 6, we can see that three binary numbers can be used to completely number all the medicine bottles. Therefore, we need to select three mice for the experiment.
3) Perform a binary serial number on the medicated bottle, and let the mouse drink the potion in BITs (when you drink 1, when you do not drink 0), as shown below:
Mouse Binary Code Water bottle No. |
A |
B |
C |
0 |
0 |
0 |
0 |
1 |
0 |
0 |
1 |
2 |
0 |
1 |
0 |
3 |
0 |
1 |
1 |
4 |
1 |
0 |
0 |
5 |
1 |
0 |
1 |
Then let the mouse a drink the water numbered 4 and 5; The Mouse B drink the water numbered 2 and 3; rats C go to drink water in 1, 3, and 5 bottles
If the rats A, B, and C are not dead (000), the water in the water bottle numbered 0 is highly toxic;
If the rats A and B are not dead and the rats C die (001), the water in the water bottle numbered 1 is highly toxic;
If the rats A and C are not dead and B is dead (010), the water in the water bottle numbered 2 is highly toxic;
If a is not dead, B and C are dead (011), the water in the water bottle numbered 3 is highly toxic;
If a is dead, B and C are not dead (100), the water in the water bottle numbered 4 is highly toxic;
If rats a and c die, and B does not die (101), the water in the water bottle numbered 5 is highly toxic;
(Essentially: we can keep the location of the mouse unchanged and label 0 for the dead mouse., Add label 1, A string of binary codes is obtained. After this binary code is converted into a decimal number, the numbers of highly toxic water bottles are obtained)
4) as the number of water bottles increases, we can use 2 ^ m> = n to calculate the number of mice required.
Use a mouse to drink poison