There are 1000 barrels of wine, of which 1 barrels are poisonous. How many mice do I need at least?

Source: Internet
Author: User

There are 1000 barrels of wine, of which 1 barrels are poisonous. Once eaten, the toxicity can occur after 2 hours of death. Now use the mouse to do the experiment, give you 3 hours to find that bucket of poisoned wine, ask at least how many mice need. (Hint: wine can be mixed)

The title, the mice after a week after a reaction, asked to find 1000 barrels a week after a bucket of wine, the minimum number of mice needed.

One:
The answer is: 10, and Binary, which is a topic of C + +. (Microsoft has been out of this problem)

Two:
Because 2^10 = 1024 the answer is 10.
Specifically you will be the drug from 0000000000-11111001111 number then let each mouse drink a bit of all the water on the 1, and then through the comparison will be able to know

Three:
10 mice were ordered in order, each barrel of wine converted to binary by number, to the corresponding position of 1 of the mice drink. The last mouse to die is a few, and then into a binary system, and then turn into a decimal is the first few barrels of wine

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.