Jump to content
Urch Forums

hard math riddle: two numbers between 1 and 99


anabolik

Recommended Posts

if you solve this, please email me at anabolikfrolik@yahoo.com..............

 

a man comes up with two numbers between 1 and 99 (meaning not 1 or 99 but from 2 to 98). The sum of these two numbers is under 99. He tells one person the sum of these numbers and another person the product of these numbers. The person with the product comes up to the person with the sum and says "i don't know the two numbers". The person with the sum replies with "i know that you don't know the two numbers". Immediately, the man with the product says "now i know the two numbers" and the man with the sum says "now i know the two numbers too". What are the two numbers? There is no word play involved.. it is a real problem with a real answer. Feel free to find the answer any way possible. Thanks! my email is anabolikfrolik@yahoo.com

Link to comment
Share on other sites

Originally posted by anabolik

 

if you solve this, please email me at anabolikfrolik@yahoo.com..............

a man comes up with two numbers between 1 and 99 (meaning not 1 or 99 but from 2 to 98). The sum of these two numbers is under 99. He tells one person the sum of these numbers and another person the product of these numbers. The person with the product comes up to the person with the sum and says "i don't know the two numbers". The person with the sum replies with "i know that you don't know the two numbers". Immediately, the man with the product says "now i know the two numbers" and the man with the sum says "now i know the two numbers too". What are the two numbers? There is no word play involved.. it is a real problem with a real answer. Feel free to find the answer any way possible. Thanks! my email is anabolikfrolik@yahoo.com

 

Let's call the product p, and the guy who has it P,

and the sum s and the guy who has it S.

 

For P to know the answer, p=axb

where a and b are primes ( not necessariliy distinct).

 

So if P doesn't know the answer, then a and b are not obviously primes.

 

For S to know that P doesn't know the answer, S must know that

 

no primes a and b exists such that s=a+b

 

The list of primes from from 2 to 98 inclusive are:

 

2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97

 

using the list we can calculate all the sums obtainable by adding two primes. There are only few sums not obtainable by that method. They are:

 

27 41 51 57 71 83 87 93 97

 

Now, we know that the value can't be a prime for it to be a product too. So we eliminate the primes, and are left with

 

27 57 87

 

However, some of these are the products of two primes. If they were, then P would've known the answer. So we eliminate them too. And we are left with just

 

27

 

So 27 can be obtained only by 9 x 3

 

so our numbers are

9 and 3

 

 

This is the only method I can think of. Maybe there is an easier method. Or am I totally wrong?

 

AmigoRo

 

 

 

Link to comment
Share on other sites

Trying again

 

Let's call the product p, and the guy who has it P,

and the sum s and the guy who has it S.

 

For P to know the answer, p=axb

where a and b are primes ( not necessariliy distinct).

 

So if P doesn't know the answer, then a and b are not obviously primes.

 

For S to know that P doesn't know the answer, S must know that

 

no primes a and b exists such that s=a+b

 

The list of primes from from 2 to 98 inclusive are:

2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97

 

 

Here is where I made a mistake:

 

using the list we can calculate all the sums obtainable by adding two primes. There are only few sums not obtainable by that method. They are:

 

27 41 51 57 71 83 87 93 97

 

11 17 23 27 29 35 41 47 51 57 59 65 71 77 79 87 89 93 95 97

 

So these are the possible sums.

 

But if a and b are the two numbers, then what is the minimum a x b for a + b that makes 97?

It's 95 and 2, but

95 x 2 = 190 which is bigger than 99

 

Only numbers less than 51 can be made by adding a to b, without a x b exceeding 99. So we can eliminate all numbers greater than 51. And we are left with:

 

11 17 23 27 29 35 41 47 51

 

Those are the possible sums.

 

For 51 we get

2 x 49 = 98

 

If 98 is the product, it could be either 2 x 49 or 7 x 14

so P doesn't know the numbers. But for S to know that P doesn't know, it has to be 2 and 49. The sum of 7 and 14, i.e., 11, is not in our A list. So P and S both realise that the numbers are 49 and 2.

 

For 47

2 x 45 = 90

Hmmm... it could 2 and 45 too, 'cos 19 nor 21 are in our A list.

 

For 41

2 x 39 = 78

 

 

For 35

2 x 33 = 66

3 x 32 = 96

 

For 29

2 x 27 = 54

3 x 26 = 78

 

For 27

2 x 25 = 50

3 x 24 = 72

4 x 23 = 92

 

For 23

2 x 21 = 42

3 x 20 = 60

4 x 19 = 76

5 x 18 = 90

 

For 17

2 x 15 = 30

3 x 14 = 42

4 x 13 = 52

5 x 12 = 60

6 x 11 = 66

7 x 10 = 70

8 x 9 = 72

 

For 11

2 x 9 = 8

3 x 8 = 24

4 x 7 = 28

5 x 6 = 30

 

 

Stumped again. Is there more than one answer ?

 

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

as far as I can tell, we can only hope to get families of pairs, and not a definite answer.

 

here's the best that I could come up with: any pair of numbers of the form:

2^n, prime number

will do. try it?!

 

if S knows that P cannot have the answer, then P must be looking at an odd sum, since if the sum was en even number, it could be broken down into a sum of two primes (among other pairs). In that case, S cannot know FOR SURE that P will not be looking at a product that only breaks down into two primes. Since S is sure, the P must know that the sum S is an odd number.

 

With that in mind, we now look at the product. Any number, the product P in particular, should be broken down into its prime divisors. In general, this can be expressed as:

P = 2 x 2 x 2 x .... x p1 x p2 x p3 x...

where it breaks down into a certain number of 2's and a certain number of odd primes.

 

It can be easily checked that only those combinations with one odd prime divisor will yield to number that add to an odd sum, which S must have seen in order to ascertain that P cannot possibly hope to find the numbers (our starting statement). We can also rule out the Products P that can be divided by a single 2, since in that case 2xp can be immediately recognized by Mr. P.

 

As a generalization, any pair of numbers of the form 2^n and prime number will satisfy the conversation.

 

I hope this is anywhere near accuracy.

 

Adel

Link to comment
Share on other sites

  • 6 months later...

Is the answer 4 and 13?

 

I have heard this riddle a long time ago and tried to program is but didn't finnish it. Today I found the riddle back on this forum and programmed it again. My program comes with 4 and 13 (as the only solution), is this correct ?

 

-Ronald

 

This is the program:

 

Sub main()

   For b = 2 To 98
       For a = 2 To 98
           If a + b '               Debug.Print a; b,
               If [u]Not[/u] P_knows(a * b) Then
'                   Debug.Print "P knows not",
                   If S_knows_that(a + b) Then
'                       Debug.Print "S knows that",
                       If P_knows_now(a * b) Then
'                           Debug.Print "P knows now",
                           If S_knows_now(a + b) Then
'                               Debug.Print "S knows now",
                               MsgBox Format(a) + ", " + Format(b)
       End If: End If: End If: End If: End If
'       Debug.Print
'       DoEvents
   Next a, b
   
End Sub

Function P_knows(Product As Integer)                    'Does P know the numbers?

   t = 0
   
   For I = 2 To Sqr(Product)                           'Sqr to exclude the same numbers (e.g. 8 = 2 * 4 and 4 * 2)
       If Product Mod I = 0 Then t = t + 1             'P doesn't know if you can divide it by more then one number
       If t > 1 Then Exit For                          'no need to check futher
   Next
   
   P_knows = t = 1
   
End Function

Function S_knows_that(Sum)                              'Does S know that P can't know the numbers?

   For I = 2 To Sum  2                                ' 2 to exclude the same numbers (e.g. 17 = 2 + 15 and 15 + 2)
       If P_knows(i * (Sum - i)) Then                  'for all the possible sums P should not be able to know the combination
           S_knows_that = False
           Exit Function
       End If
   Next i
   
   S_knows_that = True
       
End Function

Function P_knows_now(Product)                           'Does P know the two numbers after S knows that P can't know them?

   t = 0

   For I = 2 To Sqr(Product)
       If Product Mod I = 0 Then                       'P can only say that if there is just one combination
           If I + (Product  i)             If t > 1 Then Exit For                      'no need to check futher
       End If
   Next i
   
   P_knows_now = t = 1
           
End Function

Function S_knows_now(Sum)                               'Does S know the two numbers too after P knows them?

   t = 0

   For I = 2 To Sum  2                                'S can only say that if there is just one combination
       If P_knows_now(i * (Sum - i)) Then t = t + 1
       If t > 1 Then Exit For                          'no need to check futher
   Next i
   
   S_knows_now = t = 1
           
End Function

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

I think the numbers are 3 & 4.

 

Here goes the explanation:

 

Lets assume that the numbers are a & b and the product is p and the sum s.

 

p=a*b

s=a+b

 

let the person who knows the product be P and the person who knows the sum be S.

 

P doesn't know the numbers so both a & b cannot be prime. Given that both a & b are not prime there is one more info that P can have abt the product. The lowest possible product is 12. This is the only info that can put restrictions on the number of possible sums.

 

When S says that he knows that P doesn't know the numbers, it means S also knows that both the numbers are not prime. How does he know that?

 

The sum of two prime numbers will always be even unless one of the numbers is 2. If S is so sure that both the numbers are not prime, that means the sum must be odd. But then how is S so sure that one of the numbers is not 2. The only reason can be, the sum is such that subtracting 2 from it gives a prime number. So S is sure that both the numbers are not prime (however one can be prime and one can be non-prime) and one of the numbers is not 2.

 

Now when S tells P that he knows that P doesn't know the numbers, P guesses the numbers. So by this time P had already narrowed the number of possible sums. This is only possible if product given to him is 12.

 

If the product is 12, possible combinations are 2*6 and 3*4. But from S's statement its clear that he has ruled out 2 as one of the numbers. Also if the numbers are 2 and 6, the sum will be even and S cannot confidently say that both the numbers are not prime. So the only combination remaining would be 3*4. P figures this out. When P figures this out, S also realises that P had narrowed the number of sums down and that means the product must be 12. Hence he also figures that the numbers are 3 and 4.

 

This is the solution I came out with. Not sure whether correct.

 

Sam

Link to comment
Share on other sites

Hello Sam,

 

I can't follow your reasoning but I am quiet sure it can't be 3 and 4 because in that case the person with the sum is not able to reply with "i know that you don't know the two numbers"; he would get 7 (3+4). From his perspection the numbers could then be 3+4 or 2+5 in the case of 2+5, the person with the product has 10 and should be able to know the combination as 10 can only be made out of 2x5 (both 2 and 5 are prime numbers).

 

Best regards,

Ronald

Link to comment
Share on other sites

  • 4 months later...

the answer is 2 and 2.

 

why? let me explain.

The product is 2X2=4 and that would make the sum 2+2=4

There is nothing in this word problem that says each number has to be individual and clearly the sum and product of these equate to the same answer. Therefore, the person with the sum and the person of the product would end up with the same answers. Look at how it is written and you'll see that 2 and 2 is the answer.

 

 

 

a man comes up with two numbers between 1 and 99 (meaning not 1 or 99 but from 2 to 98). The sum of these two numbers is under 99. He tells one person the sum of these numbers and another person the product of these numbers. The person with the product comes up to the person with the sum and says "i don't know the two numbers". The person with the sum replies with "i know that you don't know the two numbers". Immediately, the man with the product says "now I know the two numbers" and the man with the sum says "now I know the two numbers too". What are the two numbers? There is no word play involved.. it is a real problem with a real answer. Feel free to find the answer any way possible.

Link to comment
Share on other sites

  • 4 years later...

It is not 2 and 2, Product guy would know his number immediately since 2 and 2 are the only valid factors for 4. ((2,2),(4,1)) and "1" is not a valid choice.

 

 

the answer is 2 and 2.

 

why? let me explain.

The product is 2X2=4 and that would make the sum 2+2=4

There is nothing in this word problem that says each number has to be individual and clearly the sum and product of these equate to the same answer. Therefore, the person with the sum and the person of the product would end up with the same answers. Look at how it is written and you'll see that 2 and 2 is the answer.

Link to comment
Share on other sites

In my opinion it’s 25 and 50

As it was said, If the product guy don’t know the solution, Then

numbers both can’t be prime simultaneously (but one of them still can)

Аs the sum guy knows that product guy can’t know the solution, then there sum must be odd

(if the sum will be even then numbers can be prime and there is an opportunity that P guy knows the answer)

If the sum is odd then one of the numbers must be odd (let it be a) and the other is even (call it b)

Then the product will be a*b or 2*a*(b/2)

The P guy must know the separate numbers. But there can be two pairs from the last equation.

He can choose pair 2*a and b/2, or a and b. And there is only one point when these pairs will be the same thing – when a=b/2. Then b=2a and their sum will be

a+b=3a

a

And we already know, that it can’t be even (because 2a is even already)

So there is an odd row from 3 to 31

3 5 7 9 11 13 15 17 19 21 23 25 27 29 31

a can’t be prime Because if it will be than P guy will know the solution without asking S guy

so it leaves

9 15 21 25 27 for a

And

18 30 42 50 54 for b

And only the pair 25 and 50 has the product (1250=2*5*5*5*5) that can be factorize in only one way (2*5*5) and 5*5 that fit for all conditions

 

Am I wrong?

Link to comment
Share on other sites

I think the riddle is stated wrong. There is no need to tell us that the sum is less than 99, even if it is. Giving away too much info!

 

Plus, I think it goes like this:

 

Mr. P: "I don't know the numbers."

Mrs. S: "Hmmm, I don't either."

Mr. P: "Now I know the numbers."

Mrs. S: "Oh, now I know them, too!"

 

Update: I was wrong, the one I heard went like this:

Mr. P: "I don't know the numbers."

Mrs. S: "I already knew you couldn't know them."

Mr. P: "Now I know the numbers."

Mrs. S: "Oh, now I know them, too!"

 

 

Which is basically the same as what the one here posted. But telling us the sum is less than 99 is definitely an unnecessary hint.

Link to comment
Share on other sites

rbode got it right. this riddle is not solved by whipping up a quick formula. It requires brute force.

 

First, create a list of all your Possible pairs and write them out with their sums and products as well. I believe there are (97*97 + 97)/2 = 4753 such pairs, right? (I am ignoring the "sum

 

2,2,4,4

2,3,5,6

2,4,6,8

2,5,7,10

2,6,8,12

...

3,3,6,9

3,4,7,12

...

4,4,8,16

4,5,9,20

...

etc.

 

 

Step 1) We know it is not a pair of primes, or Mr. P would know them immediately from the product.

So eliminate all those from the possibilities, but keep them in a new list of "Prime Pairs" for future reference.

 

Step 2) We know it is not a pair whose sum could also come from a pair of primes, or S would not be sure that P doesn't know. So check the list of Prime Pairs and get a listing of all the sums. Now eliminate any pairs in the Possibilities that have a sum in that list. So here for example, you lose 3,4 because it has the same sum as the prime pair 2,5.

 

Step 3) Now, we know that with this information and knowing the product, Mr. P knows the answer, so therefore the product must only have one pair of possible multiplicants whereby their sum can not be expressed as the sum of a pair of primes. So find the list of products that were eliminated in Step 2. Now find all the remaining Possibilities that share one of those same products and only have one pair left that makes that product. These are the only products Mr. P could have.

 

Step 4) If there is more than one possibility left, your last step is to go through all the Possibilities eliminated in Step 3, and check their sums. Now find all the remaining Possibilities that share one of those same sums and only have one pair left that makes that sum. These are the only sums Mrs. S could have.

 

Hopefully at this point you are left with only 1 possible pair, and that is your solution. (4,13)

 

Math Forum Discussions

 

Wish I could find that Matlab code...

 

PS - I just realized that since you have an upper bound, there are other certain Products of non-Prime-Pairs that can be eliminated as possibilities because there is no other way to factor them with the given constraints. So they can be considered "Pseudo-Prime Pairs" for the purposes of this problem. For example, (95, 97) would give S=192 and P=9215 and there is only one way to factor this with two numbers between 1 and 99, so P would know right away. In fact, this might make a drastic cut in the possibilities left after Step 1, giving you approximately the same benefit of the "sum

Link to comment
Share on other sites

Excellent work parseljc! :tup:

 

Obviously this is a problem that spans the decades. Now someone just needs to email anabolik back in 2002:

 

"if you solve this, please email me at Yahoo!..."

 

Hopefully anabolik wasn't on a short deadline or anything. This is like math archeology. Drudging up ancient society's math problems and solving them. Hmmm... i'm seeing a TV show in the making.

 

 

rbode got it right. this riddle is not solved by whipping up a quick formula. It requires brute force.

...

 

Hopefully at this point you are left with only 1 possible pair, and that is your solution. (4,13)

 

Math Forum Discussions

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...