[Turn] to identify the toxic syrup problem with mice

https://www.cnblogs.com/mingmingruyuedlut/archive/2011/10/14/2211237.html

Question set: there are N bottles of water, a bottle of water which is highly toxic, if mice drink will die in 24 hours time.

Q: How many mice can be detected with a bottle of water which is highly toxic?

The less the number of mice with a shorter time and, given the reasonable process and Conclusion: The requirements.

 

My problem-solving ideas are as follows:

 

This is a binary switch (0/1 ) problem, analogous to the Hamming code check algorithm , the binary number syrup (0000000,0000001,0000010,0000011 ...), calculates the minimum number of binary bits can be all mice fully Numbering;

And selecting a binary digit of mice, the mice corresponding to the respective bits, then go to the same bit, traversing different mice, this bit is set to 1 if this Little syrup drink bottle is, this bit is not 0 drink (As for how to drink within the range is not what we consider to be press-bit mixed syrup were, into another bottle, let the mice drink syrup after mixing, of course, after the number of syrup mixed with a number of selected mice Are the same);

Finally, the life and death of mice to identify which bottles of medicine is highly toxic.

 

Analogy Case Study:

1) Suppose there are six bottles of syrup, a bottle of which are highly toxic, other non-toxic

2) by calculating 2 ^ 3 = 8> = 6, 3-bit binary number can be seen completely all numbered vials, so we have to choose three mice do experiments

3) of the vial binary number, and let the drink syrup bit mice (met 1 to drink, drink met 0), as shown in a schematic view:

                    Mice

        Binary code

No water bottles

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

A mouse then allowed to drink water bottle numbered 4,5; 2,3 number mouse B drink water bottle; C mice numbered 1,3,5 drink water bottle

If mice A, B, C did not die (000), the number 0 in water bottle toxic;

If mice A, B is not dead, C die (001), the number of the water bottle 1 is highly toxic;

If the mouse A, C did not die, B die (010), the number of water bottles 2 are highly toxic;

If the mouse did not die A, B, C die (011), the number of the water bottle 3 is highly toxic;

If the mice die A, B, C did not die (100), the number of the water bottle 4 is highly toxic;

If the mouse A, C die, B did not die (101), the number of the water bottle 5 is highly toxic;

(Essentially: We can maintain the position of the same mice, the mice did not die to be labeled 0 , 1 Dead label , will come to a string of binary code, binary code in this section will be converted into decimal, That is highly toxic water bottles come numbering)

4) the number increases as the number N of the bottle, we have by 2 ^ M> = N calculated required to mice M

Guess you like

Origin www.cnblogs.com/qxxnxxFight/p/11126084.html