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!
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.
I have read about this in Wikipedia before nice solution though.
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
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.
Why can't 3 and 8 work?
Log in to reply
Because Sam would not have known that Paula didn't know what the numbers were from their product.
@akash deep had 2 and 3 been the numbers Paula wouldn't have said "I don't know the numbers"
Genius ! ..................................................
same here, I had come across this puzzle earlier in wikipedia. But I feel your solution is much better ..
How does Paula know his sum must be odd?
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
Log in to reply
If the sum was 9, it could be (4, 5) and 4*5 makes 20 and Paula was also confused.
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?
Log in to reply
the computer solution is the first one, depending on the code; there are multiple solutions
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.
"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.
4 and 7 are worrking.
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.
How can you say that the sum is 17 and product equals 52, im not geting any clue about it.plz help
What if the numbers are 2 and 15. Why wouldn't that work ?
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?
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.
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.
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.
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
The product is unique to a certain sum, and
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 1 3 .
a , b s ^ p ^ P ∈ { 2 ; … ; 9 9 } : : = a + b : : = a b : : = { p prime , p < 1 0 0 } : two distinct unknown numbers Sam’s number, all possible values s are collected in S Paula’s number, all possible values p are collected in P set of the first 25 primes If s ∈ S and p ∈ P are generated by the same unknown numbers, we say " s , p are connected".
By symmetry, it's enough to consider a < b . Using the upper bound for the sum s ^ < 1 0 0 , we find estimates for S , P : s ^ = a + b > 2 a ≥ 4 ; b = s ^ − a < 1 0 0 − 2 = 9 8 ⇒ S = { 5 ; … ; 9 9 } , P ⊆ { 2 ⋅ 3 ; … ; 9 6 ⋅ 9 7 } Then realize that if you know both s ^ , p ^ , you can calculate 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 = 3 9 and s = 5 : p = 3 9 = 3 ⋅ 1 9 ↔ 3 + 1 3 = 1 6 ; s = 5 = 2 + 3 ↔ 2 ⋅ 3 = 6 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 determines s " and " s determines p ", respectively.
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!" Sam: "I knew you didn’t!" Sam: "I don’t know either!" Paula: "Now I know them!" Sam: "Now I know them, too!" ⇔ ⇔ ⇔ ⇔ ⇔ " p ^ doesn’t determine s ^ ∈ S " " s ^ isn’t determined by any p ∈ P " " s ^ doesn’t determine p ^ ∈ P 2 " " p ^ determines s ^ ∈ S 3 " " s ^ is determined by exactly one p ∈ P 3 " ⇔ ⇔ ⇔ ⇔ ⇔ s ^ , p ^ s ^ , p ^ s ^ , p ^ s ^ , p ^ s ^ , p ^ ∈ S 1 , P 1 ∈ S 2 , P 2 ∈ S 3 , P 3 ∈ S 4 , P 4 ∈ S 5 , P 5 ( 1 ) ( 2 ) ( 3 ) ( 4 ) ( 5 )
The shrinking sets S k , P k contain the remaining sums and products that Paula and Sam had not been able to eliminate.
The conditions (1) - (3) are ridiculously tedious to test by hand - they would need every valid factorization of every product p ∈ P and every valid partition of every sum s ∈ S . Instead, we try to find efficient ways to eliminate some values from S , as it as it contains much fewer elements than P . We show conditions (1), (2) lead to (1'), (2'), respectively:
p ^ s ^ = p 1 p 2 , = p 1 + p 2 , p ^ s ^ = p 1 3 , = p 1 2 + p 1 , p ^ s ^ = k p 3 ≤ 5 4 for any for any p 1 , p 2 , p 3 p 1 , p 2 , p 3 ∈ P , ∈ P , p 1 p 1 < p 2 , < p 2 p 3 ≥ 5 0 ( 1 ′ ) ( 2 ′ )
To verify statement (1'), assume p ^ is not of either of the three forms in (1'). In all cases, p ^ = a b has exactly one valid factorization such that a , b > 1 as well as a < b . But using that single factorization, Paula would know both numbers - contradiction!
For statement (2'), assume 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 = 5 3 ( s − 5 3 ) 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 > 5 4 from S straight away. Then we calculate all sums p 1 + p 2 ≤ 5 4 with primes 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 , and 5 1 , because it is determined by p = 1 7 ⋅ 3 4 , to end up with the following 10 sums: { 1 1 ; 1 7 ; 2 3 ; 2 7 ; 2 9 ; 3 5 ; 3 7 ; 4 1 ; 4 7 ; 5 3 } = S 2 = S 3 , P 2 = P 3 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 they are connected to (about 15min on paper). The products we checked make up the set P 2
Every sum s ∈ S 2 is connected to multiple products p ∈ P 2 , so we cannot eliminate any values with condition (3)!
Condition (4):
We need a way to identify sums s ∈ S 3 that are determined by products p ∈ 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
If we find a valid partition of the first kind, we know s is connected to the product p = 2 m p 1 . This product has only one valid factorization with an odd and an even number, so p determines 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 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 have (at least) one valid partition of the first kind. All s ∈ S 3 except the ones in the following list even have two of them! To find them, check if s − 2 m is prime, starting with m = 1 and increase m until you get to negative values.
We now list the exceptions with their partitions of first and second kind, if possible: s 2 m + p 1 2 m + p 1 p 2 1 7 4 + 1 3 2 9 1 6 + 1 3 4 + 2 5 4 1 4 + 3 7 1 6 + 2 5 5 3 1 6 + 3 7 3 2 + 2 1
Condition (5):
After the last step, all s ∈ S 3 ∖ { 1 7 } can be determined by more than one p ∈ 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 the product is connected to: s = 1 7 s ′ ∈ S 3 2 + 1 5 5 + 6 3 + 1 4 2 + 2 1 4 + 1 3 5 + 1 2 3 + 2 0 6 + 1 1 2 + 3 3 7 + 1 0 2 + 3 5 8 + 9 3 + 2 4
We note: s = 1 7 is determined by exactly one product p = 4 ⋅ 1 3 = 5 2 , and it is the only solution: s = 1 7 , p = 5 2 = 4 ⋅ 1 3 = a b ⇒ ( a , b ) = ( 4 ; 1 3 )
amazing work!
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.
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 |
|
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?
Log in to reply
That is actually a good question. Anyone? :-)
Log in to reply
What if the sum was 8 and product 12?
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.
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)
watta nice!!!!
Problem Loading...
Note Loading...
Set Loading...
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:
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.
What Paula learns: the numbers are either 4 and 13 or 2 and 26, so Sam has been whispered either 17 or 28.
What Sam learns: nothing.
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:
What Paula learns: nothing. (WE, the puzzle solvers, need to know this in order to eliminate other possibilities, as we'll get to later...)
What Sam learns: Aha! Only if the product is 52 can she know my sum has to be 17.
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?).