Questions and my solutions from Mr. S and Mr. P

Source: Internet
Author: User
Tags set set
This question was found last Saturday when I helped my brother find the logic question. This question comes from the puzzles of mr. s and Mr. P, a professor at Stanford University in the United States. Questions: questions about Mr. S and Mr. P There are two natural numbers x, y, 2 <= x <= Y <= 99. Mr. S knows the sum of the two numbers, and Mr. P knows the product P of the two numbers, the two of them had the following conversation: S : I'm sure you don't know what these two numbers are, but I don't know either. P: When you say this, I will know what these two numbers are. S: Me too. Now I know. Can you deduce the two numbers through their sessions? (Of course, Mr. S and Mr. P are both very smart)After seeing it, I immediately fell in love with it, but it was not hard to feel ashamed until today. It is not difficult to think logically. In fact, the first sentence of S was half understood in the evening. by the afternoon of the next day, the first sentence of S and the sentence of P were thoroughly understood, I should have done it at that time, but I ignored the second sentence of S. So I thought over the past few days that I was missing a condition, but I was not sure, if I can't think of it today, I read the question again and found that I used less than one condition. So I entered the second sentence of S, and then I thought and verified it. Next let's talk about my ideas (P, which is written in inferences, indicates the prime number, and P in uppercase is not the prime number ). 1. If S is the following number, according to 2 ≤ x ≤ y ≤ 99, Mr. S can directly know X and Y
  • S = 4, x = 2, y = 2
  • S = 5, x = 2, y = 3
  • When S is 197, x = 98, y = 99
  • When S is 198, x = 99, y = 99
According to the second half of Mr. S's First sentence, s cannot be any of the four numbers above. 2. If both X and Y are prime numbers, then Mr. P can easily calculate X and Y, for example, P = 481 = 13 × 37, when learning p. Therefore, we know from the first half of Mr. S's first sentence that s cannot be expressed as the sum of two prime numbers, that is, X and Y cannot be both prime numbers. For example, if S = 84, there may be X = 5, y = 79, then P may be P = 5 × 79 = 395, mr P can easily obtain X and Y. Therefore, if S is 84, Mr. s cannot be sure that Mr. P does not know X and Y, so S Is the number of sums that cannot be expressed as two prime numbers. (A) You can reduce the value range of S. 3. If there is only one prime number in X or Y and the number is greater than 50, then Mr. P can still solve X and Y only when he knows p. Let p be decomposed into the product of the following prime numbers: P = p0p1p2... in Pn, PN is a prime number greater than 50. Because PN> 50 is used for any prime number P, there are PNP> 100. Therefore, there must be a number equal to PN in X and Y, the other number is equal to p0p1p2... pn-1. The minimum prime number greater than 50 is 53, so if 53 + 2 ≤ S ≤ 53 + 99, when 55 ≤ S ≤ 152, mr. S is not certain that Mr. P cannot calculate X and Y. The maximum prime number smaller than 99 is 97, so when 97 + 2 ≤ S ≤ 97 + 99, that is, when 99 ≤ S ≤ 196, mr. S is not certain that Mr. P cannot calculate X and Y. Therefore, according to Mr. S's First sentence, the value range of S is: 6 ≤ S ≤ 54 (B) 4. according to the verification of godebach's conjecture, we can easily determine that all the even numbers in the range [6, 54] can be expressed as the sum of two prime numbers (if you are not afraid of trouble, you can also verify it yourself ), S is an odd number in the range [7, 53. Because 2 is a prime number, there are some odd numbers that can also be expressed as the sum of two prime numbers, finding out the prime numbers in [3, 53], adding them to 2, and then removing the range [6, 54] an odd number expressed as the sum of two prime numbers: 7 = 2 + 59 = 2 + 713 = 2 + 1115 = 2 + 1319 = 2 + 1721 = 2 + 1925 = 2 + 2331 = 2 + 29; 33 = 2 + 3139 = 2 + 3743 = 2 + 4145 = 2 + 4349 = 2 + 47. Therefore, according to Mr. S's First sentence, it can be determined that the value of S is only one of the following: 11, 17, 23, 27, 29, 35, 37, 41, 47, 51, 53 Set set a = {11,17, 35, 51, 53}, then S ε(C) 5. according to Mr. P's sentence, Mr. P obtained the conclusion c Based on Mr. S's First sentence, and calculated x and y based on known p. Let the prime number of P be decomposed: P = p0p1p2... pi... Pn (n > 2) There is a unique X = p0p1p2... Pi Y = PI + 1... PN Yes X + y = s εThe conclusion (condition) is named D, and the P meeting the condition forms the Set B. For example, if p = 130 is set, the prime number decomposition for P is as follows: P = 2 × 5 × 13. At this time, the solutions of X and Y may be) or (130), but only () this group of solutions satisfied: 10 + 13 = 23, a so when P =, according to the Conclusion C, Mr. P can solve X and Y. But when P =, 28 ,...... Mr. P can also find X and Y. 6. According to Mr. P's sentence, Mr. S has also solved X and Y, that is, according to condition d, S has solved X and Y. That is, in S, the sum expression s = x0 + y0s = X1 + y1s = x2 + y2 ...... S = xn + YN only has a group of (XI, Yi) product P meet the condition d, that is, meet p = xi x Yi P in B so that Mr. S can solve X and Y. Verify the elements in set a one by one: When S = 11, S = 2 + 9, P = 2 × 9 = 18, B S = 3 + 8, P = 3 × 8 = 24 ε B s = 4 + 7, P = 4 × 7 = 28 ε B when S = 17, only S = 4 + 13, P = 4 × 13 = 52, B when S = 23, S = 4 + 19, P = 4 × 19 = 76, B S = 7 + 16, P = 7 × 16 = 112 records B s = 10 + 13, P = 10 × 13 = 130 records B ...... In short, only when S = 17, there is a unique group (4, 13) that satisfies S = 4 + 13 = 17, a P = 4 × 13 = 52, B. X = 4, y = 13I wrote a program to verify this verification process.

 

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.