[Guess a number] Tell A to the two numbers, and product to B to find out what these two numbers are.

Source: Internet
Author: User

The two numbers from 1 to 20 tell a, and the product tells B. A says that he does not know the number, and B also says that he does not know. Then a says that he knows, and B says that he also knows, what are the two numbers?

Analysis:

Set to S and product to M.

First, A: I don't know.

Note: s can be divided into multiple combinations, while 2 = 1 + 1, 3 = 1 + 2, 40 = 20 + 20, 39 = 19 + 20. There is only one decomposition method, therefore, s belongs to the [] set.

Second, B: I don't know either.

Note: m can also be divided into multiple combinations, so m is not a prime number.

Furthermore, A: Now I know.

Note:In the S decomposition method, only one of them is a combination after multiplication, and all other decomposition methods are a prime number after multiplication.. In this way, a can not know according to B, and the possibility that all multiplication is a prime number (M is a prime number, and there is only one Decomposition Method: 1 * prime number, after the remainder is multiplied, the combination of the numbers is the solution obtained by.

After multiplication, there is a prime number: only 1 * prime number = prime number!

All prime numbers from 1 to 20: t = {2, 3, 5, 7, 11, 13, 17, 19 }.

Set X to any prime number in T. Then, the possible values of S are: {2 + 1, 3 + 1, 5 + 1, 7 + 1, 11 + 1, 13 + 1, 17 + 1, 19 + 1}, I .e.: Ss = {3, 4, 6, 8, 12, 14, 18, 20}

S = 3: 3 is not in the [4, 38] Set, exclude;

S = 4: 4 = 2 + 2 = 1 + 3, () Multiply by 4 (non-prime number, meet the condition), () Multiply by 3 (prime number, excluded );

When S = 6: 6 = 1 + 5 = 2 + 4 = 3 + 3, multiply by 5, 8, 9, and there are two composite numbers, exclude;

All other values are decomposed by multiple aggregate numbers. Therefore, all values are excluded.

Therefore, the solutions obtained by a are 2 and 2.

Finally, B: I know.

Note: B thinks from the standpoint of a based on its known m value and can get the result of M = 4. The verification is as follows:

M = 4 = 2*2 = 1*4. The sum result is 4, 5. 5 is not in the SS set. Therefore, the result is 2 and 2.

Therefore, the final answer is 2 and 2.

[Reference]

Http://blog.csdn.net/yahohi/article/details/7453005

[Guess a number] Tell A to the two numbers, and product to B to find out what these two numbers are.

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.