Several Digital problems (weighing, etc)

Source: Internet
Author: User

Ing is a very simple and practical mathematical technique that can often achieve clear results.

Ing to integers is frequently used.

Simple ing of discrete values is relatively trivial. If the ing can be combined with sequences, it can be very extraordinary.

For example, I have recently asked a question: 1000 bottles of water, one of which is toxic. When a white mouse dies after drinking for a week, how many white mice can find the bottle of water within a week?

Idea 1: 1000 bottles of water are reflected in the mouse. There are about 1000 bottles of water. The dead mouse knows which bottle of water it is.

Idea 2: The above ing is very basic. Although the answer is correct, the answer is much more information than the question. The question asks you to know That bottle of water is toxic. You need to know the situation of a bottle, rather than whether the status of 1000 bottles is toxic or not. The information "only one bottle of toxic" is not fully utilized.

To know which bottle is toxic, the key is how to identify the bottle number. The bottle number can be mapped to the state of the mouse.

There are only two statuses for mice: one is to drink this bottle of water, the other is not to drink this bottle of water; that is, 0 or 1. the solution is to map 1000 to the state 0, 1. A single 0, 1 cannot represent the large number of 1000. Therefore, we need to combine a 0, 1 sequence, which is similar to binary encoding. The number of State units is 2, and the number of k State units is 2 ^ K. 2 ^ 10 = 1024> 1000, so you only need K> = 10 to map 0 ~ Different encoding of 1000. That is, only 10 mice are needed.

Example:

Mineral water bottle 1, 2, 3, 4, 5, 6, 7, 8,

Mouse A: 01010101

Mouse B: 00110011

Rat C: 00001111

0 indicates not to drink, 1 indicates to drink, and connects the numbers corresponding to the mouse ABC to find that the code is unique, that is, any bottle is toxic, the combination of dead mice is different. The combination of dead mice may be one, or two, or the other is not dead. In short, they must be different. Based on the mouse's death, you can view the table to find out which bottle is poisonous. Therefore, the ing effect is achieved.

Key points:

1. Find the correlation points, drink water in rats, and die from poisoning

2. Whether to find uniqueness, such as one of the 1000 bottles

3. What is a status unit? Rats drink water, and do not drink water

4. How to combine status units? In this example, the association uniqueness is encoded in hexadecimal notation.

 

Question 2: One of 27 iron balls is relatively light. How can I find this ball three times on the balance?

Idea 1: One exclusion half may be the first method most people think.

Idea 2: 2/3 can be ruled out at a time. First, it is divided into three parts. If the weight is the same, the group is naturally left. If the weight is different, the group is naturally light.

Train of Thought 3: after the term is called once, the iron ball may be light, heavy, or standard (ordinary ).

000000000111111111222222222

0 is light, 1 is heavy, 2 is standard, and 1 is standard. The above are the possible results of the first round.

A: 000000000111111111222222222

Called B: 000111222000111222000111222

C: 012012012012012012012012012

The above are the typical results after the three arguments (other results must not be difficult, that is, they can be transformed to this result or easier than this result ).

The first round is to divide 27 parts into three parts and mark them (0, 1, 2). The second round is to divide each of the three parts into three smaller parts, each group has one copy and the other is called. In the third round, we continue to divide each small part into three parts. The encoding of each ball combined with the three parts is different. What is the purpose? It means that each ball has a one-to-one match with the called result, and the special ball must also be matched by the unique result.

Which result corresponds to a special ball? Because the encoding of each ball is different, that is, the weighing of any ball is determined, either the standard ball or the heavy ball (also the Standard Ball ). A light ball won't become a heavy ball, and a heavy ball won't become a light ball. The changed digital shows that it is not a special ball, it is a standard ball that is affected by a special ball (for example, a special ball causes it to become lighter on the same side and causes it to become heavier on the other side ). There are only two balls, 000 and 111, which are always unchanged. According to the question, we look for special balls.

 

Key points:

I. "3" is a breakthrough in solving problems. Why can this problem be solved three times? 27/3 = 9/3 = 3 = 1. Naturally, the ball corresponds to the weighing result.

 

Question 3: One of the 12 balls is inconsistent with the other balls. How can I find this ball three times a day?

A: 000011112222

Construction: 02220011,011

Called B: 00001111

Construction:, 1

C: 1100

The result of "A" must be imported to standard ball 2 and constructed into three parts: 00,011,011. All parts can be called once.

02220011 indicates that the result 0001111 is the same as that of 011 (one of them is similar to the other ).

Then import the standard ball to construct the two parts, 01,1.

0122 is called 1100. That is, 1 is the final result and the ball is heavy.

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.