Mr. S and Mr. P

There are two integers, x and y, both of them are valued between 2 and 99 (inclusive)

Mr. S only knows the sum of the two numbers, while Mr. P only knows the product of the two numbers.

Mr. S told Mr. P, "I know you won't know what the two numbers are."

Then Mr. P said "Now I know what are they."

Followed by Mr. S "I get it now."

What is the product of the two numbers?


The answer is 52.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Tony Li
Dec 22, 2014

A very first thing to consider: How did Mr. S know that Mr. P won't know what the two numbers are in the first place.

We can find that the number Mr. P got must not be the product of two primes, or he would get the two numbers simply by writing down the two primes.

So for Mr. S to make sure that Mr. P won't know the two numbers, the number he got must not be able to be written as the sum of two primes, or he would not be able to make sure that Mr. P didn't get the product of two primes, in which case Mr. P would know what the two numbers are.

(For example, if Mr. S got 20, then there is a possibility that the two numbers are 13 and 7, in case Mr. P got 91 and he would work it out immediately)

As the number Mr. S got cannot be written as the sum of two prime numbers, we know that he could not get any even numbers ( 2 is impossible as both numbers are larger than or equal to 2, and any even number larger than 2 can be written as the sum of two primes, because Goldbach's conjecture is shown to hold up through 4X10^18 and we are only working within 200 for now ) and odd numbers which are 2 larger than an odd prime are also eliminated in the same way.

Another limitation for the number Mr. S got is that it cannot be larger than 53, because if he got a number larger than 53, there is a possibility that one of x or y is 53, and in that case Mr. P would be able to work it out immediately as both numbers are smaller than or equal to 99 (For example, if Mr. S got 59, then it is possibly that the two numbers are 53 and 6, and if Mr. P got 53X6=318, he would work it out immediately as 318 cannot be written as the product of another pair of numbers both smaller than or equals to 100)

For now, we can work out all the possibilities of the sum of number x and y: First, the number is smaller than or equals to 53 Second, it is odd, and is not 2 larger than an odd prime Third, it is larger than or equal to 4

So we only have 11 17 23 27 29 35 37 41 47 51 53 left as possibilities of the sum.

Then consider what did Mr. P say: he got the two numbers immediately after hearing Mr. S saying "I know you won't know" So, after hearing what Mr. S said, Mr. P has done the same process and has obtained the same conclusion as us about the possibilities of the sum of the two numbers, and he obtained the two numbers with the product of them plus the new evidences of the sum of the two numbers.

Because the sum of x and y is odd, so their product must be even. So the number Mr. P had can be written as: (odd number)X2^n. Because Mr. P worked the two numbers out immediately, so the odd number mentioned beforehand cannot be a composite number (If it is composite, Mr. P cannot make sure how to factorise the number he got uniquely. For example: if he got 108, he cannot make sure if he should write it as 3X36 or 4X27) So, the number Mr. P got, or the product of x and y, must be able to be written as (odd prime)X2^n

After Mr. P said that he got the two numbers, Mr. S responded immediately that he also worked them out, which means knowing that the product is written as odd primeX2^n gave Mr. Sum limitations about how he should write the number he got into sum of x and y in an unique way.

So we can use brutal force to see if the possible sums we obtained earlier would be written as the sum of 2^n and an odd prime uniquely.

Among all the possible sums we obtained earlier, only 17, 29, 41, 53 satisfies.

So we have only four possibilities left: 17=4+13 product 52 29=16+13 product 208 41=4+37 product 148 53=16+37 product 592

And let's go through the remaining possibilities again: If the sum was 53, it could also be written as 6+47, and if Mr. P got 6X47, he could still be able to tell the two numbers immediately (For 6X47 can also be written as 3X94, sum 97, but 97 is not within the possible sums we obtained earlier, so Mr. P would know that the x and y are 6 and 47, but Mr. S cannot make sure if the two numbers are 16 and 37 or 6 and 47.) In similar processes, we can eliminate 53, 41 and 29, and we need to prove 17 fits perfectly:

17=4+13=3+14=2+15=5+12=6+11=7+10=8+9 2X15=6X5, 6+5=11, it is a possible sum, so Mr. P cannot make sure 3X14=21X2, 21+2=23, it is a possible sum, so Mr. P cannot make sure 5X12=20X3, 20+3=23, it is a possible sum, so Mr. P cannot make sure 11X6=33X2, 33+2=35, it is a possible sum, so Mr. P cannot make sure 7X10=2X35, 2+35=37, it is a possible sum, so Mr. P cannot make sure 8X9=24X3, 24+3=27, it is a possible sum, so Mr. P cannot make sure

While 4X13 can only be written as 4X13 or 2X26, and 2+26 is not a possible sum, so 17 is the only possible sum, which can only be written as 4+13. So the product of x and y is equal to 4X13=52

can anyone please explain it briefly...

Mrigank Krishan - 6 years, 5 months ago

Log in to reply

My English is very, very bad...Sorry for that XD

Tony Li - 6 years, 5 months ago

Log in to reply

Check this out: http://en.wikipedia.org/wiki/Impossible_Puzzle

Ajit Athle - 6 years, 5 months ago

Log in to reply

@Ajit Athle @Sanchit Aggarwal The reason 2 and 9 could not be the numbers is that Mr. S would have not been able to make his final statement that he knew which numbers they were.

Let's say the numbers were 2 and 9. Then Mr. S would have 11, tell Mr. P that P wouldn't know, and then Mr. P would be able to deduce that his product of 18 could only be factored in one way to numbers that sum to a number that isn't a sum of two primes. Then P says he knows the numbers. HOWEVER, then Mr. S knows that Mr. P was able to deduce this, so he looks at which numbers that sum to 11 also yield a product that only has one factorization in which the factors sum to a number not expressible as the sum of two primes. S considers that 2 and 9 would have given Mr. P an 18, and the only way to factor 18 appropriately is 2 and 9. However, he then considers 3 and 8. Then Mr. P would have 24, which can be factored into (2,12), (3, 8), or (4,6). Of the three pairs, only (3,8) sum to a number that cannot be written as the sum of two primes. So if the numbers were actually 3 and 8, then Mr. P would have been able to make the same conclusion. So Mr. S would have no way of knowing from Mr. P's conclusion which of (2,9) or (3,8) were actually correct.

Daniel Juncos - 4 years, 6 months ago

Hey, i got the answer in a similar way, but you can't generalise the prime factorization into p*2^n. Suppose the product was 50, the possible sums Mr. P could have assumed are 15 and 27, but 15-2 is a prime, so he can still find out that numbers are 25,2 and not 10,5 without ambiguity.

Rishab M - 6 years ago

How can you say that sum can't be greater than 53.Take 79 as an example, it cannot be expressed as sum of 2 primes but if product is 74X5=370=37X10..Still P can't figure out the exact answer.Also some even numbers cannot be expressed as sum of PRIMES WITHIN 2 AND 99 though goldbach conjecture still holds true.E.g.190=101+89. So you got the right answer by narrowing down options from flawed reasoning and you didn't take into account all possible options.Still the answer is correct 13X4..And it can be verified

Ruturaj Vyawahare - 5 years, 9 months ago

If Mr.P got the number 28, x and y could be 2 and 14 or 4 and 7. But, if it were 2 and 14, the sum will be 16 and 5+11 will be a possibility, then Mr.S couldn't afirm Mr.P didn't know the numbers. So, if it were 4 and 7, the sum would be 11 and the possibilities: 2+9, 3+8, 4+7 , 5+6 (no 2 primes summing)

Gustavo Jambersi - 5 years, 7 months ago

Why is 18 not the answer? Let us suppose the numbers are 2 and 9. Then Mr S receives the number 11, and since it cannot be expressed as the sum of two primes he says that Mr P can not find out the numbers. Now, Mr P who had received the number 18 could have only 2 possibilities, either (2,9) or (3,6). He eliminates the latter pair upon hearing Ms S's statement as 3+6=9 which can be expressed as a sum of two primes namely 2 and 7. Thus he is left with only (2,9) and thus his last statement saying that he has found them.

Sanchit Aggarwal - 4 years, 8 months ago

Log in to reply

Please see my comment below. I left it in the wrong place.

Daniel Juncos - 4 years, 6 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...