1000 bottles of potion, of which at most one bottle is highly toxic

Source: Internet
Author: User

Problem table on mathematical SP class binary

1000 bottles of potion, of which at most one bottle is highly toxic

Now, I will give you 10 puppies to test which bottle of medicine is toxic or all is non-toxic within 24 hours.

(It takes 20 hours for the puppies to determine if they are poisoned)

 

Each of the 10 puppies has two cases of death and death, so there are two cases of death: 10 to the power = 1024.
1024 is greater than 1000, that is to say, it is possible to determine the poison.
We can build a mathematical model for this problem by using a binary representation of 1000 bottles of medicine and a binary representation of a puppy.

1000 bottles of poison numbered 1-1000
Puppy No. 10-1
1st bottles for 1st puppies.
2nd bottles for 2nd puppies.
3rd bottles for 1st 2 puppies.
4th bottles for 4th puppies.
5th bottles for 1st 4 puppies.
6th bottles for 2nd 4 puppies.
7th bottles for 1st 2 4 puppies.
...
And so on
...
1,000th bottles for 10th 9 8 7 6 4 puppies.
Depending on the death of the puppy, you will know the situation of taking the medicine.

In the binary system, the 1000 bottles are represented
1.10.11.100.101.110.111.1000.1001.1010.1011 ......
.... 1111101000
Check which dogs are dead, such as 10th, and 2.
We can see that the poison is 1,001,001,111st bottles.
The converted back-to-decimal format is 1 + 2 + 4 + 8 + 64 + 512 = 591.
That is to say, 591st bottles are poison.

 

Reverse Thinking: Assuming the X bottle of water is toxic, we can get the binary value of X. The binary value of X is consistent with that of the rabbit.

 

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.