Go back to previous page
Forum URL: http://www.cut-the-knot.org/cgi-bin/dcforum/forumctk.cgi
Forum Name: This and that
Topic ID: 119
Message ID: 3
#3, RE: Puzzle:"Then, I know your sum","Then, I know your product"
Posted by mark (Guest) on Jun-28-01 at 09:07 PM
In response to message #2
i'm no regular at these boards and i'm no math wizz, but someone pointed me here cuz i spent some time trying to solve this problem and i wanted a place to check my solution. so, here goes (all comments appreciated)

Knowing only the sum, S claims there is no way P can know what the two numbers are, based solely on the product. That means that S knows that P can not have a product of two primes - for if P had a product of 2 primes, he would be able to tell the factors right away (if P has 35, he knows it's 5 and 7 (primes); if P has 40, he can't possibly tell which the two numbers are (possibilites 2-20, 4-10, 8-5).

How can S know this? S can only know that P can not know the two numbers if S holds a number WHICH CAN'T POSSIBLY BE WRITTEN AS A SUM OF TWO PRIMES. That means S has an odd number, for all even numbers can be written as a sum of two primes (this is called Goldbach's theorem i believe). If S holds an odd number, then the two original numbers must be an even one (A) and an odd one (B). Small remark to this - the even number may not be 2, for then too P can find the solution.

On to the next step - P says 'then i know your sum'. This means that the knowledge that A is even and B is odd is NECESSARY AND SUFFICIENT to determine A and B from their product. How can this be? It's necessary - there is more then one way to factor the product. It's sufficient - of all possible ways to factor out the product, only one splits it in factors with 1 even and the other one odd (only one factorisation with an odd sum). This can only be the case if the even number is a whole power of 2 (but not 2 itself), while the odd number is a prime.

Since the integers must be smaller then 100, this means A can be 4, 8, 16, 32, or 64. B is a prime between 2 and 100 (there are 25 of them i believe, from 3 to 97). Of these couples, all which have a sum that can be written as 2 + a prime must be removed. For example, 8+23 is also 2+29 so it doesn't count (if S held 31 as sum, it couldn't possibly claim P couldn't know the solution because it would be possible for P to hold 2*29 = 58 as sum, in which case P would have the solution immediately). Remarkably, there are a lot of these couples - 62 of them to be exact. This leaves 63 couples of numbers.

Finally, S says 'then i know your sum'. This means that, based on the fact that P can find the numbers from S's first claim, S can also find the numbers. This means that the sum S is only the sum of one candidate couple. For example, 11 is the sum of 4 and 7, but also of 8 and 3. In both cases S knows P can't find the factors, and in both cases P can find the factors when S says so, but there is no way for S to know which to choose. Crossing out the couples not matching this final criterium does, however, not narrow the solution down to 1. The previously mentioned solution 4 and 13 is the only solution if you not only suppose A and B are smaller then 100, but P and S also. Then the product is 72 and the sum is 17. However, if you allow P and S to be greater then 100, there are more solutions. These are the couples i found acceptable solutions:

4 - 13, 37, 61, 79
8 - 89
16 - 13, 37, 43, 97
32 - 87, 89
64 - 43, 59, 61, 67, 71, 73, 79, 83, 97

A total of 20 solutions.

Hope i didn't make too many mistakes - but if i did i'd love to hear about them and discuss or explain if needed.

Mark