Test the agent for multiple bottles of liquid poisoning drugs

Source: Internet
Author: User

I would like to record this interesting question from my teacher one day.

Question: there are 1000 bottles of liquid, one of which is a bottle of chronic poison. After a week of feeding the poison, the mouse will suddenly lose vital signs, ask the minimum number of mice that can be used to know which bottle of liquid contains the poison (note that the concentration and amount of the poison are not considered here. If there is a reaction to the poison, the mixed liquid can be fed ).

Method 1:

Divide 1000 mice into two parts as far as possible in the binary system, one part is 2 ^ 9, that is, 512, and the other part is 488, take the mixed liquid on any side and test it with a mouse. After knowing the result, you can choose which side to continue to be split. The 512 side can be further divided into 9 layers by 2 points, 488 can be divided into 484 9 layers and 4 8 layers, that is, according to the probability, toxic bottles can be located in any of the bottles, the number of mice and the number of layers are required by the Division, it is 10*996/1000 + 9*4/1000 = 9.996, and takes 9.996 weeks.

Result: The first integer is greater than or equal to 10 mice and 10 weeks in total.

Method 2:

The encoding method requires at least 10 bits for 1000 bottles, from 00 0000 0000 to 11 1110 1000 (high on the left side and low on the right side). The mice correspond to 10 bits in sequence, each mouse drinks only the liquid of the bottle with the corresponding digit of 1. If there is a bottle of 10 1010 1010, then 10th, 8, 6, 4, and 2 mice should drink the liquid in the bottle. 9th, 7, 5, 3, and 1 mice should not drink, all the bottles are waiting for a week after drinking. When the white mouse is in a state, the vital signs are lost; otherwise, the result is 0, and the 10 bits are discharged from high to low, indicates the serial number of the bottle containing the poison.

Results: a total of 10 mice were needed, which took 1 week.

The second method is dominant.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.