The Impossible Puzzle

I choose two different integers, both greater than 1, whose sum is less than 100. I whisper this sum to Sam, and whisper their product to Paula. They then have the following conversation:

Paula: I don’t know the numbers.

Sam: I knew you didn’t. I don’t either.

Paula: Ah, now I know them.

Sam: Now I know them too.

What is the LARGER number that I chose?

Credit for this problem goes to Hans Freudenthal in 1969 -- but do not Google it yet or you will have the solution spoiled!


The answer is 13.

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.

5 solutions

Kevin Bourrillion
Apr 25, 2014

The numbers are 4 and 13. First, I'll convince you that these are a valid solution, and leave for another post (or poster) to describe how to actually find the solution.

Note of course that if one knows both the sum and the product it does uniquely determine the two numbers.

Here's how it all goes down, chronologically, complete with inner monologues:

Me (whispered to Sam): "The sum is 17."

What Sam learns: They might be 2 and 15, 3 and 14, ..., or 8 and 9. They are one odd and one even; they can't both be prime. Paula will be whispered one of: 30, 42, 52, 60, 66, 70 or 72. None is a product of primes, so she won't know the numbers yet.

Me (whispered to Paula): "The product is 52."

What Paula learns: the numbers are either 4 and 13 or 2 and 26, so Sam has been whispered either 17 or 28.

Paula: "I don't know the numbers."

What Sam learns: nothing.

Sam: "I knew you didn't."

What Paula learns: his sum cannot be expressed as a sum of two primes -- therefore it must be odd (Goldbach conjecture). The numbers are 4 and 13! I've got it!

What Sam learns: she knows my sum is odd now. The possibilities are:

  • If she was told 30, she knows that my sum is one of 11, 13 or 17.
  • If 42, she knows my sum is 13, 17 or 23.
  • If 52, she knows my sum is 17.
  • If 60, she knows my sum is 17, 19 or 23.
  • If 66, she knows my sum is 17, 25 or 35.
  • If 70, she knows my sum is 17, 19 or 37.
  • If 72, she knows my sum is 17 or 27.

Sam: "I don't either."

What Paula learns: nothing. (WE, the puzzle solvers, need to know this in order to eliminate other possibilities, as we'll get to later...)

Paula: "Ah, now I know them."

What Sam learns: Aha! Only if the product is 52 can she know my sum has to be 17.

Sam: "Now I know them too."

Hopefully this convinces you that 4 and 13 are a solution. How to find that solution is a subject for another post (perhaps you want to make it?).

I have read about this in Wikipedia before nice solution though.

Mardokay Mosazghi - 7 years ago

can 2 and 3 not be the numbers because if you tell someone the product of 2 numbers is 6 and both are greater than one then he will do the prime factorization and get 2 and 3 similarly the sum 5 can be expressed as 2+3 only for a,b > 1

akash deep - 7 years ago

Log in to reply

Paula and sam are mathematicians so if either of them got one of them got 6 or 5 as their product and sum respectively, than they would be able to extrapolate what the numbers were. Sam would know that the only combination of numbers to add up to 5 would be 3,2 given the conditions and so Paula would know the same for the factoring.

Uraz Oflaz - 6 years, 11 months ago

Why can't 3 and 8 work?

Anusha Brown - 5 years, 4 months ago

Log in to reply

Because Sam would not have known that Paula didn't know what the numbers were from their product.

David Krüger - 5 years, 4 months ago

@akash deep had 2 and 3 been the numbers Paula wouldn't have said "I don't know the numbers"

Debapriya Biswas - 4 years, 10 months ago

Genius ! ..................................................

Duyệt Phạm - 5 years, 6 months ago

same here, I had come across this puzzle earlier in wikipedia. But I feel your solution is much better ..

Krishna Ramesh - 7 years ago

How does Paula know his sum must be odd?

Greg Grapsas - 5 years, 3 months ago

Hi! 9 & 2 can be the solution. 18= (3)(6) or (9)(2)

if sum was 9, there is possibility of (2,7) combination in which case Paula would have known the solution. Sam is being sure that Paula do not know the numbers because 11= 9+2= 8+3= 7+4=6+5

Sameer Bharadwaj - 5 years, 1 month ago

Log in to reply

If the sum was 9, it could be (4, 5) and 4*5 makes 20 and Paula was also confused.

ZH X - 1 month, 4 weeks ago

Although the solution programs appear to generate the same result, the logic above seems to me to be defective. I have modified the text to apply to a different pair of numbers, which appears to verify them as a solution. If we are to believe the computer solutions, there is only 1 answer, so the argument as presented appears to allow extraneous solutions. With apologies to Kevin, please observe:

The numbers are 13 and 16. First, I'll convince you that these are a valid solution, and leave for another post (or poster) to describe how to actually find the solution. Note of course that if one knows both the sum and the product it does uniquely determine the two numbers. Here's how it all goes down, chronologically, complete with inner monologues:

Me (whispered to Sam): "The sum is 29."

What Sam learns: They might be 2 and 27, 3 and 26, ..., or 14 and 15. They are one odd and one even; they can't both be prime. Paula will be whispered one of: 54, 78, 100, 120, 138, 154, 168, 180, 190, 198, 204, 208, or 210. None is a product of primes, so she won't know the numbers yet.

Me (whispered to Paula): "The product is 208."

What Paula learns: the numbers are either 16 and 13 or 8 and 26 or 4 and 52, so Sam has been whispered either 29, 34, or 56.

Paula: "I don't know the numbers."

What Sam learns: nothing.

Sam: "I knew you didn't."

What Paula learns: his sum cannot be expressed as a sum of two primes -- therefore it must be odd (Goldbach conjecture). The numbers are 16 and 13! I've got it!

What Sam learns: she knows my sum is odd now. The possibilities are:

If she was told 54, she knows that my sum is one of 29, 21 or 15.

If 78, she knows my sum is 41, 29 or 19.

If 100, she knows my sum is 29, or 25.

If 120, she knows my sum is 43, 29 or 23.

If 138, she knows my sum is 71, 49, or 29.

If 154, she knows my sum is 79, 29 or 25.

If 168, she knows my sum is 59, 31, or 29.

If 180, she knows my sum is 63, 49, 41, 29 or 27.

If 190, she knows my sum is 97, 43 or 29.

If 198, she knows my sum is 69, 39, 31 or 29.

If 204, she knows my sum is 71, 55 or 29.

If 208, she knows my sum is 29.

If 210, she knows my sum is 73, 47, 41, 37, 29, or 21.

Sam: "I don't either."

What Paula learns: nothing. (WE, the puzzle solvers, need to know this in order to eliminate other possibilities, as we'll get to later...)

Paula: "Ah, now I know them."

What Sam learns: Aha! Only if the product is 208 can she know my sum has to be 29.

Sam: "Now I know them too."

Hopefully this convinces you that 16 and 13 are a solution. How to find that solution is a subject for another post (perhaps you want to make it?).

Although it is easier for Paula to figure out the numbers, it is not necessary for Sam to screen as many possibilities as listed above. Goldbach's Conjecture imposes conditions on possible sums that allows Paula to select the correct pair of numbers for her product. In this problem, it also imposes conditions on the product as well. Since the sum cannot be even, it must be an even plus an odd. The product of such pairs is even, of course. To be able to identify the pair of numbers, the product can contain only 1 odd prime factor and any number of powers of 2. If the product contained more than 1 odd prime, there would be multiple ways of factoring without violating the odd sum condition. An odd prime combined with powers of 2 would still be even, and the sum would still be odd, but no longer unique. In the general case, besides 52 and 208, there are 5 other products which do satisfy this condition. Both Paula and Sam can figure the pair of numbers directly at this point. Simply separate the product or sum into the even and prime parts. However, this is where I get lost. I can't find the way to reduce the list of possibilities for the reader who doesn't have the advantage of actually knowing either the sum or the product. If the coders are to be believed, there is a way. Any ideas?

Tom Capizzi - 5 years ago

Log in to reply

the computer solution is the first one, depending on the code; there are multiple solutions

Eliud Alejandro Maldonado Sanchez - 3 years, 5 months ago

1 problem is Kevin doesn't use the sum being less than 100 in his solution. Second, SOME odd numbers can be represented as the sum of 2 prime. So for 100, she would know the sum is 29, as 25 is 2*23.

Alex Burgess - 2 years ago

"What Paula learns: nothing. (WE, the puzzle solvers, need to know this in order to eliminate other possibilities, as we'll get to later...)" -- Paula has to learn from the indecision of Sam. Sam must have 2 options for a particular product. The product must have two different sets of factors, one of them must lead to a confusing sum.. while the other must lead to a sure sum.

The lowest sure sum is 7. But the sum can not be 8=6+2=3+5. Sam would be definite that it is not (5,3) once Paula said she is not sure (5*3=15-> only option)

We must start with Paula.. and get into the flow...

U have a flaw.. "If 52, she knows my sum is 17." it wd be: If 52, she knows my sum is 17, 28.

We are getting the scenario.. of Paula, the Mathematician Speaker and Sam... from outside.. & WE MUST KNOW NOTHING.

& Paula did not duck. Nobody is ducking. They are computer programs designed to interact transparently on basis of what they truly finds.

Ananya Aaniya - 4 years, 10 months ago

4 and 7 are worrking.

Kartik Malik - 4 years, 7 months ago

Log in to reply

Sam knows he revealed to Paula that the sum is odd, and he knows that is the fact that finally solved it for her. Yes, that would be true if she had been whispered 28, but it also would have been true if she'd been whispered 24 (that is, if the original numbers had been 3 and 8), so he still doesn't know the answer.

Kevin Bourrillion - 4 years, 5 months ago

How can you say that the sum is 17 and product equals 52, im not geting any clue about it.plz help

sam dave - 4 years, 2 months ago

What if the numbers are 2 and 15. Why wouldn't that work ?

Sameep Rehlan - 7 years, 1 month ago

Log in to reply

I believe that is addressed above. Paula would only know that the sum is one of 11, 13 or 17 (stemming from the number pairs 5+6, 3+10 or 2+15). How would she have been able to narrow it down to 2+15?

Kevin Bourrillion - 7 years, 1 month ago

Log in to reply

Okay, yes.. I was trying to firm a solution, which is when I confused myself. This problem is ming boggling in the true sense.

Sameep Rehlan - 7 years, 1 month ago

Man, I just can't understand this explanation. The confusion starts from the part in which Paula gets to know that the numbers are either 4 and 13 or 2 and 26...... Please help me, brother.

Sanjay Ragavendra - 5 years, 1 month ago
Daniel Ploch
Jul 23, 2014

Here's a short, simple, declarative Python program to deduce the numbers. Every variable prefixed with 'sam' is a set of sums, and every variable prefixed with 'paula' is a set of products.

from collections import defaultdict
sumsToProds = defaultdict(set)
prodsToSums = defaultdict(set)
for x in range(2, 100):
  for y in range(x+1, 100-x):
    s = x + y
    p = x * y
    sumsToProds[s].add(p)
    prodsToSums[p].add(s)

# Paula doesn't know iff the sum isn't unique for her product
paulaDoesntKnow = set([k for k, v in prodsToSums.items() if len(v) >= 2])
# Sam doesn't know iff the product isn't unique for his sum
samDoesntKnow = set([k for k, v in sumsToProds.items() if len(v) >= 2])
# Sam knows Paula doesn't know iff all of the products for his sum fall under 'Paula doesn't know'
samKnowsPaulaDoesnt = set([k for k in samDoesntKnow if sumsToProds[k] <= paulaDoesntKnow])
# Paula knows now iff the number of sums which fit her informational model are reduced to 1 by Sam's statement
paulaKnowsNow = set([k for k in paulaDoesntKnow if len(prodsToSums[k].intersection(samKnowsPaulaDoesnt)) == 1])
# Sam knows now iff the number of products which fit his informational model are reduced to 1 by Paula's statement
samKnowsNow = set([k for k in samKnowsPaulaDoesnt if len(sumsToProds[k].intersection(paulaKnowsNow)) == 1])

print samKnowsNow # set([17])
print sumsToProds[17].intersection(paulaKnowsNow) # set([52])
# Basic algebra yields 4 + 13 = 17, 4 * 13 = 52

Extra: Consider the parameterized problem P(N), where N is the exclusive upper limit of the sum of the two numbers. P(100) is solvable, and yields (4, 13). I was curious to see at what N, (or if there even was such an N), where P(N) is unsolvable. It turns out N exists! And N < 2000 - see if you can find it.

Andre Bourque
Jun 18, 2018

Using Goldbach's conjecture and similar logic in Bourrillion's post, we see that the sum must be one of the numbers that cannot be expressed as 2 + p, for any prime p. The first few of these numbers are 11, 17, 23, 27, 29, 35, 37.

We can list out these numbers and their possible products.

  • 11: 18, 24, 28, 30

  • 17: 30 , 42 , 52, 60 , 66 , 70 , 72

  • 23: 42 , 60 , ...

  • 27: 50, 72 , ...

  • 29: 54, 78, ...

  • 35: 66 , ...

  • 37: 70 , ...

Now from the conversation, we know that

  1. The product is unique to a certain sum, and

  2. that the rest of the products that correspond to that sum appear in another sum's list.

The first observation follows from the fact that Paula is able to identify the sum -- it must appear on a single list. If Sam knows the product from this information, that means that the rest of his possible products are not unique; otherwise, Paula could not be able to pin down the sum.

Notice that from the numbers I have provided, all of 30, 42, 60, 66, 70, and 72, which are products in 17's list, appear on other lists, as indicated in bold. This leaves 52 -- does it appear on another list? No, because it is clear that the lists are increasing, and since it is not already listed elsewhere, it can never be listed again.

Therefore the sum is 17 and the product is 52, meaning the numbers are 4 and 13 \fbox{13} .

Carsten Meyer
May 1, 2020

Definitions

a , b { 2 ; ; 99 } : two distinct unknown numbers s ^ : = a + b : Sam’s number, all possible values s are collected in S p ^ : = a b : Paula’s number, all possible values p are collected in P P : = { p prime , p < 100 } : set of the first 25 primes \begin{aligned} a,\:b&\in \{2;\:\ldots;\:99\}:&&\text{two distinct unknown numbers}\\[.5em] \hat{s}&:=a+b:&&\text{Sam's number, all possible values }s\text{ are collected in }S\\[.5em] \hat{p}&:=ab:&&\text{Paula's number, all possible values }p\text{ are collected in }P\\[.5em] \mathbb{P}&:=\{p\text{ prime},\: p<100\}:&&\text{set of the first 25 primes} \end{aligned} If s S s\in S and p P p\in P are generated by the same unknown numbers, we say " s , p s,\:p are connected".

By symmetry, it's enough to consider a < b a<b . Using the upper bound for the sum s ^ < 100 \hat{s}<100 , we find estimates for S , P S,\:P : s ^ = a + b > 2 a 4 ; b = s ^ a < 100 2 = 98 S = { 5 ; ; 99 } , P { 2 3 ; ; 96 97 } \begin{aligned} \hat{s}&=a+b>2a\geq 4; &&& b&=\hat{s}-a< 100-2=98 &&&\Rightarrow&&&& S&=\{5;\:\ldots;\:99\},& P&\subseteq\{2\cdot 3;\:\ldots;\:96\cdot 97\} \end{aligned} Then realize that if you know both s ^ , p ^ \hat{s},\:\hat{p} , you can calculate a , b a,\:b : Knowing one pair is equivalent to knowing the other!

Finally, notice there are some special products and sums that are connected to exactly one value. For example p = 39 p=39 and s = 5 s=5 : p = 39 = 3 19 3 + 13 = 16 ; s = 5 = 2 + 3 2 3 = 6 \begin{aligned} p=39&=3\cdot 19 &\leftrightarrow&&3+13&=16;&&&&& s=5&=2+3&\leftrightarrow &&2\cdot 3&=6 \end{aligned} If Paula gets such a product, she can safely guess Sam's number, and vice versa! For such products and sums that are connected to only one value, we will say " p p determines s s " and " s s determines p p ", respectively.


The discussion step by step

Let's analyze the statements of Paula and Sam's discussion, step by step, to find out what they know about their numbers:

Paula: "I don’t know the numbers!" " p ^ doesn’t determine s ^ S " s ^ , p ^ S 1 , P 1 ( 1 ) Sam: "I knew you didn’t!" " s ^ isn’t determined by any p P " s ^ , p ^ S 2 , P 2 ( 2 ) Sam: "I don’t know either!" " s ^ doesn’t determine p ^ P 2 " s ^ , p ^ S 3 , P 3 ( 3 ) Paula: "Now I know them!" " p ^ determines s ^ S 3 " s ^ , p ^ S 4 , P 4 ( 4 ) Sam: "Now I know them, too!" " s ^ is determined by exactly one p P 3 " s ^ , p ^ S 5 , P 5 ( 5 ) \begin{aligned} &\text{Paula: "I don't know the numbers!"} &\Leftrightarrow&&&\text{"}\hat{p} \text{ doesn't determine }\hat{s}\in S\text{"} &\Leftrightarrow && \hat{s},\:\hat{p}&\in S_1,\:P_1&&(1)\\[1em] &\text{Sam: "I knew you didn't!"} &\Leftrightarrow&&& \text{"}\hat{s}\text{ isn't determined by any }p\in P\text{"} &\Leftrightarrow && \hat{s},\:\hat{p}&\in S_2,\:P_2&&(2)\\[1em] &\text{Sam: "I don't know either!"} &\Leftrightarrow&&& \text{"}\hat{s}\text{ doesn't determine }\hat{p}\in P_2\text{"} &\Leftrightarrow && \hat{s},\:\hat{p}&\in S_3,\:P_3&&(3)\\[1em] &\text{Paula: "Now I know them!"} &\Leftrightarrow&&& \text{"}\hat{p}\text{ determines }\hat{s}\in S_3\text{"} &\Leftrightarrow && \hat{s},\:\hat{p}&\in S_4,\:P_4&&(4)\\[1em] &\text{Sam: "Now I know them, too!"} &\Leftrightarrow&&& \text{"}\hat{s}\text{ is determined by exactly one }p\in P_3\text{"} &\Leftrightarrow && \hat{s},\:\hat{p}&\in S_5,\:P_5&&(5) \end{aligned}

The shrinking sets S k , P k S_k,\: P_k contain the remaining sums and products that Paula and Sam had not been able to eliminate.


Proof

The conditions (1) - (3) are ridiculously tedious to test by hand - they would need every valid factorization of every product p P p\in P and every valid partition of every sum s S s\in S . Instead, we try to find efficient ways to eliminate some values from S S , as it as it contains much fewer elements than P P . We show conditions (1), (2) lead to (1'), (2'), respectively:

p ^ p 1 p 2 , p ^ p 1 3 , p ^ k p 3 for any p 1 , p 2 , p 3 P , p 1 < p 2 , p 3 50 ( 1 ) s ^ p 1 + p 2 , s ^ p 1 2 + p 1 , s ^ 54 for any p 1 , p 2 , p 3 P , p 1 < p 2 ( 2 ) \begin{aligned} \hat{p}&\neq p_1p_2,& \hat{p}&\neq p_1^3,& \hat{p}&\neq kp_3&&&\text{for any}&&&& p_1,\:p_2,\:p_3&\in\mathbb{P},& p_1&<p_2,& p_3 \geq 50&&&&&(1')\\[1em] \hat{s}&\neq p_1+p_2,& \hat{s}&\neq p_1^2+p_1,& \hat{s}&\leq 54&&&\text{for any}&&&&p_1,\:p_2,\:p_3&\in\mathbb{P},& p_1&<p_2&&&&&&(2') \end{aligned}

To verify statement (1'), assume p ^ \hat{p} is not of either of the three forms in (1'). In all cases, p ^ = a b \hat{p}=ab has exactly one valid factorization such that a , b > 1 a,\:b>1 as well as a < b a < b . But using that single factorization, Paula would know both numbers - contradiction!

For statement (2'), assume s ^ \hat{s} is not of either of the three forms in (2'). Then it is connected to a product of one of the forms: p = p 1 p 2 , p = p 1 3 , p = 53 ( s 53 ) \begin{aligned} p&=p_1p_2,&p&=p_1^3,& p=53(s-53) \end{aligned} In all cases, it is possible for Paula to know the numbers by (1'). But then Sam can't be sure that Paula did not know the numbers in the first place - contradiction!


  • Conditions (2'), (3):

    We eliminate all s > 54 s>54 from S S straight away. Then we calculate all sums p 1 + p 2 54 p_1+p_2\leq 54 with primes p 1 < p 2 p_1<p_2 and eliminate them from the remaining values. Even doing it by hand is fast (about 3min on paper), as most combinations are either out of bounds or dublicates.

    From the remaining list, we eliminate 6 = 2 2 + 2 6=2^2+2 , and 51 51 , because it is determined by p = 17 34 p=17\cdot 34 , to end up with the following 10 sums: { 11 ; 17 ; 23 ; 27 ; 29 ; 35 ; 37 ; 41 ; 47 ; 53 } = S 2 = S 3 , P 2 = P 3 \begin{aligned} \{11 ;\: 17 ;\: 23 ;\: 27 ;\: 29 ;\: 35 ;\: 37 ;\: 41 ;\: 47 ;\: 53\}&=S_2=S_3,&&& P_2&=P_3 \end{aligned} Even though it is a bit tedious, we test all of their 145 valid partitions to make sure none of the sums is determined by any of the products p P p\in P they are connected to (about 15min on paper). The products we checked make up the set P 2 P_2

    Every sum s S 2 s\in S_2 is connected to multiple products p P 2 p\in P_2 , so we cannot eliminate any values with condition (3)!


  • Condition (4):

    We need a way to identify sums s S 3 s\in S_3 that are determined by products p P 3 p\in P_3 . It's very helpful to check for two kinds: s = ? 2 m + p 1 s = ? 2 m + p 1 p 2 p 1 , p 2 P , 2 < p 1 p 2 , m > 0 \begin{aligned} s & \overset{?}{=} 2^m + p_1&\vee &&s & \overset{?}{=} 2^m + p_1p_2&&&p_1,\:p_2&\in\mathbb{P},&2&<p_1\leq p_2,&m>0 \end{aligned}

    If we find a valid partition of the first kind, we know s s is connected to the product p = 2 m p 1 p=2^mp_1 . This product has only one valid factorization with an odd and an even number, so p p determines s s ! If we cannot find such a partition, we look for the second kind, as a product of the form p = 2 m p 1 p 2 p=2^mp_1p_2 has at most three valid factorizations with an odd and an even number and is unlikely to be connected to another sum.

    We find all s S 3 s\in S_3 have (at least) one valid partition of the first kind. All s S 3 s\in S_3 except the ones in the following list even have two of them! To find them, check if s 2 m s-2^m is prime, starting with m = 1 m=1 and increase m m until you get to negative values.

    We now list the exceptions with their partitions of first and second kind, if possible: s 17 29 41 53 2 m + p 1 4 + 13 16 + 13 4 + 37 16 + 37 2 m + p 1 p 2 4 + 25 16 + 25 32 + 21 \begin{array}{r | r | r | r | r } s & 17 & 29 & 41 & 53 \\\hline 2^m +p_1& 4+13& 16+13& 4+37& 16+37\\ 2^m+p_1p_2& & 4+25& 16+25& 32+21 \end{array}


  • Condition (5):

    After the last step, all s S 3 { 17 } s\in S_3\setminus\{17\} can be determined by more than one p P 3 p\in P_3 : They cannot satisfy (5)! To show that 17 does, we must verify it is determined by only one of the products it is connected to. We list all valid partitions of 17 and give an example of an alternative sum s S 3 s'\in S_3 the product is connected to: s = 17 2 + 15 3 + 14 4 + 13 5 + 12 6 + 11 7 + 10 8 + 9 s S 3 5 + 6 2 + 21 3 + 20 2 + 33 2 + 35 3 + 24 \begin{array}{r | r | r | r | r | r | r | r} s=17 & 2+15 & 3+14 & 4+13 & 5+12 & 6+11 & 7+10 & 8+9\\\hline s'\in S_3& 5+6 & 2+21 & & 3+20 & 2+33 & 2+35 & 3+24 \end{array}

    We note: s = 17 s=17 is determined by exactly one product p = 4 13 = 52 p=4\cdot 13=52 , and it is the only solution: s = 17 , p = 52 = 4 13 = a b ( a , b ) = ( 4 ; 13 ) \begin{aligned} s&=17,&p&=52=4\cdot 13=ab&\Rightarrow&&(a,\:b)=(4;\:\boxed{13}) \end{aligned}

amazing work!

Kevin Bourrillion - 1 year, 1 month ago

Thank you - I really struggled to find a rigorous chain of reasoning that's managable for a human and does not involve iterating a gazillion cases as only a computer can. I really hope it's logically correct and readable as well!

The hardest parts (in my opinion) were to come up with the term of "sums that are determined by products" and find a nice criterion to identify enough of them, so only one possible solution remains (step (4') of the proof).

The verification in step (5') was a lot easier compared to that...


Edit: I finally looked up the wikipedia solution - it's pretty much the same except for one fact: I overlooked the case that Paula's product cannot have a prime factor greater than 50. If you use that too, you greatly reduce the cases later.

I've updated the proof to make it more efficient.

Edit 2: Added a remark about uniqueness of the solution. That's the part I feel most uncertain about, so feel free to remind me of any logical fallacies I may have introduced!

Edit 3: Updated the proof - it now includes a bit more manual work, but shows the solution is indeed unique.

Carsten Meyer - 1 year, 1 month ago
Ameya Salankar
May 14, 2014

Here is a python code from Wikipedia -

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
 limit = 100
   #before they talk any x*y where 1<x<y<x+y<limit is allowed as P
   PAllowed1 = {} 
   for x in range(2, limit): 
       for y in range(x+1, limit-x): 
           if x*y not in PAllowed1: 
               PAllowed1[x*y] = 1 
           else:
               PAllowed1[x*y] += 1
   # when P says I don't know, only P's with PAllowed1[P]>1 are allowed 
   SNotAllowed1 = {}  
   for x in range(2, limit): 
       for y in range(x+1, limit-x): 
           if  PAllowed1[x*y] == 1 :
               SNotAllowed1[x+y] = 1  
   # when S says I don't know, only S's that are not in the domain of SNotAllowed1 are allowed 
   PAllowed2 = {} 
   for n in range(2, limit):
     if n not in SNotAllowed1:
       for x in range(2, n//2+1):
           p = x * (n-x)
           if p in PAllowed1 and PAllowed1[p] > 1:
               if p in PAllowed2:
                   PAllowed2[p] += 1
               else:
                   PAllowed2[p] = 1 
   # only the P's that can by split to two x,y where x+y is allowed in only 1 way are allowed, i.e., PAllowed2[P]==1      
   SAllowed2 = {}  
   for n in range(2, limit):
     if n not in SNotAllowed1:
       for x in range(2, n//2+1):
           if x*(n-x) in PAllowed2 and PAllowed2[x*(n-x)] == 1:
               if n in SAllowed2:
                   SAllowed2[n] += 1
               else:
                   SAllowed2[n] = 1
   # since S knows the answer now the split can only be done in one way, so only S where SAllowed2[S]==1
   for n in SAllowed2: 
       if SAllowed2[n] == 1:
           for x in range(2, n//2+1):
               if x*(n-x) in PAllowed2 and PAllowed2[x*(n-x)] == 1:
                  print '(S,P) = ( %d , %d ), (x,y)= ( %d , %d )' % (n, x*(n-x), x, n-x)

Insane logician thinking. I completely understand the solution, but coming up with the idea in the first place is remarkable. I'll have to have a look at some more of these to get my head round them. One quick question, are these the only pair of numbers, if so how can you assume so?

Mukul Rathi - 6 years, 6 months ago

Log in to reply

That is actually a good question. Anyone? :-)

Kevin Bourrillion - 6 years, 5 months ago

Log in to reply

What if the sum was 8 and product 12?

Karan Arora - 5 years, 9 months ago

Log in to reply

@Karan Arora because selutions would be 3 and 5, or 6 and 2, 6 and 2 infact, but if it would be 5 and 3 paula would know the answer right a way, because it cant be only 5 3=15, because 1 is unable (15 1), and she dont know it in the begining, so sam would know its not 5+3 and whe would know as soon as paula would say i dont know. because only left is 6+2, for which paula wouldnt know because of multiple solutions.

Strahinja Zlatanovic - 5 years, 5 months ago

Log in to reply

@Strahinja Zlatanovic i was thinnking about similar solution(and product 12(for 4 and 3)). but there's the same problem, there would be 2 options for sam: 3+4 or 5+2=7, and then if it was 5+2=7, it would be 5x2=10, and it would be obvious choise for paula to solve if it was 10, but paula said i dont know, so sam would know its 12=4x3--->4+3=7, so she wouldnt say "i knew u wont know, i dont know either" bad english, and complicated explanation maybe, sry about that, hope u will understand (solo "u"=you, and there were be some mistakes in spelling, ignore it, ty)

Strahinja Zlatanovic - 5 years, 5 months ago

watta nice!!!!

renzo gantala - 3 years, 7 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...