Results 1 to 12 of 12

Thread: If you can solve this your a genius

  1. #1
    billfaceuk
    Guest
    I'll admit I only copied and pasted this and i don't actually understand the question but here it is:

    Two integers, m and n, each between 2 and 100 inclusive, have been chosen. The product, mn, is given to mathematician X. The sum, m + n, is given to mathematician Y. Their conversation is as follows:
    X: I don't have the foggiest idea what your sum is, Y.
    Y: That's no news to me, X. I already knew that you didn't
    know.
    X: Ahah, NOW I know what your sum must be, Y!
    Y: And likewise X, I have surmised your product !!

    Find the integers m and n.

    If you solve this you ARE a genius

  2. #2
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892
    X: I don't have the foggiest idea what your sum is, Y.
    Translation:
    I know mn, but from my knowledge of mn and this knowledge alone, it is impossible to deduce what m+n is.
    Y: That's no news to me, X. I already knew that you didn't know.
    Translation:
    I know m+n, and from this knowledge I have been able to deduce that it is impossible to know m+n by just knowing mn.
    X: Ahah, NOW I know what your sum must be, Y!
    Translation:
    I know mn, and I know that it should be impossible for me to find out m+n, but there is only one sum of two integers between 2 and 100 which make this impossible (which Yonatan didn't figure out yet), so I now know this sum!
    Y: And likewise X, I have surmised your product !!
    Translation:
    Well, you figured them out! That means with your knowledge of mn and your knowledge that it's impossible to find m+n, there is only one possible sum - and with my knowledge of the sum and the knowledge that you have been able to figure it out, I have deduced that there is only one possible product, which I now know!

    Now to think a lot. If someone can find the sum AND the product (this shows that it's possible), then it's easy to find both integers by using the equations:
    Code:
    {m + n = a
    {mn = b
    Very interesting riddle

  3. #3
    billfaceuk
    Guest
    very interesting riddle
    Thanks I try my best!

  4. #4
    Frenzied Member
    Join Date
    Jul 1999
    Location
    Huntingdon Valley, PA 19006
    Posts
    1,151

    A SWAG.

    For those unfamiliar with technical jargon, a WAG is a Wild Ass Guess with little thought behind it. A SWAG is a sophisticated Wild Ass Guess, which has some possible merit.

    My SWAG is 2 & 9, with product 18 and sum 11, which might fit the conditions here, but I am not really sure.

    What is known by both is the following.
    • If X had a product like 15 (3*5), 35 (5*7), 143 (11*13), or the product of any other two primes, he would know the sum given to Y, namely the sum of the two prime factors.
    • If Y had a sum like 20, which could be the sum of 7 and 13, he could not be certain that X did not know his sum.
    Product 18 (2*9) and sum 11 (2 + 9) seem to have some merit. I found them by noting that 11 was the smallest sum with the correct properties.

    X knows product of 18, which could be 3*6 or 2*9, so his statement that he does not have the foggiest notion is a bit of an exaggeration, but he cannot know whether Y has 11 or 9 as a sum. See below for examples of products

    Now if Y had 11 as a sum, the possible products are 2*9, 3*8, 4*5, 5*6, none of which is the product of a pair of primes. With such a sum, he would know that X could not tell what the sum was.

    Now when Y says I already knew you were in the dark, X considers the possible sums 9 & 11. 9 could be 2 + 7, which is the sum of two primes. Y could not have that sum, else he could not be sure that X was in the dark. Therefore, he knows that Y has 11 as the sum, which is not the sum of a pair of primes.

    At this point, I do not know how Y deduces the product given to X.

    Perhaps my answer is wrong. Perhaps there is a way for Y to deduce what product X has.
    Live long & prosper.

    The Dinosaur from prehistoric era prior to computers.

    Eschew obfuscation!
    If a billion people believe a foolish idea, it is still a foolish idea!
    VB.net 2010 Express
    64Bit & 32Bit Windows 7 & Windows XP. I run 4 operating systems on a single PC.

  5. #5
    Fanatic Member THEROB's Avatar
    Join Date
    Oct 2000
    Location
    I'm cold and there are wolves after me
    Posts
    575

    Re: If you can solve this your a genius

    I think the answer is 2 and 6. I have modified some code from http://www.urch.com/forums/lounge/19...en-1-99-a.html

    VB Code:
    1. Option Explicit
    2.  
    3. Function P_knows(Product As Long) As Boolean                    'Does P know the numbers?
    4.     Dim t As Long
    5.     Dim I  As Long
    6.     t = 0
    7.    
    8.     For I = 2 To roundUp(Sqr(Product))                            'Sqr to exclude the same numbers (e.g. 8 = 2 * 4 and 4 * 2)
    9.         If Product Mod I = 0 Then t = t + 1             'P doesn't know if you can divide it by more then one number
    10.         If t > 1 Then Exit For                          'no need to check futher
    11.     Next
    12.    
    13.     P_knows = t = 1
    14.    
    15. End Function
    16.  
    17. Function S_knows_that(Sum As Long) As Boolean                             'Does S know that P can't know the numbers?
    18.     Dim iKnow As Long
    19.     Dim I As Long
    20.     For I = 2 To Sum \ 2                                ' 2 to exclude the same numbers (e.g. 17 = 2 + 15 and 15 + 2)
    21.         If P_knows(I * (Sum - I)) Then                  'for all the possible sums P should not be able to know the combination
    22.             'S_knows_that = False
    23.             'Exit Function
    24.         Else
    25.             iKnow = iKnow + 1
    26.         End If
    27.     Next I
    28.    
    29.     If iKnow >= 2 Then
    30.         S_knows_that = True
    31.     Else
    32.         S_knows_that = False
    33.     End If
    34. End Function
    35.  
    36. Function P_knows_now(Product As Long) As Boolean                          'Does P know the two numbers after S knows that P can't know them?
    37.     Dim t As Long, I As Long
    38.     t = 0
    39.  
    40.     For I = 2 To roundUp(Sqr(Product))
    41.         If Product Mod I = 0 Then                       'P can only say that if there is just one combination
    42.             If I + (Product \ I) < 100 Then If S_knows_that(I + (Product \ I)) Then t = t + 1
    43.             If t > 1 Then Exit For                      'no need to check futher
    44.         End If
    45.     Next I
    46.    
    47.     P_knows_now = t = 1
    48.            
    49. End Function
    50. Private Function roundUp(dblValue As Double) As Double
    51.     On Error GoTo PROC_ERR
    52.     Dim myDec As Long
    53.  
    54.     myDec = InStr(1, CStr(dblValue), ".")
    55.     If myDec > 0 Then
    56.         roundUp = CDbl(Left$(CStr(dblValue), myDec)) + 1
    57.     Else
    58.         roundUp = dblValue
    59.     End If
    60.  
    61. PROC_EXIT:
    62.     Exit Function
    63. PROC_ERR:
    64.     'MsgBox Err.description, vbInformation, "Round Up"
    65.     roundUp = CLng(dblValue)
    66. End Function
    67.  
    68. Function S_knows_now(Sum As Long) As Boolean                              'Does S know the two numbers too after P knows them?
    69.     Dim t  As Long
    70.     Dim I  As Long
    71.     t = 0
    72.  
    73.     For I = 2 To Sum \ 2 'S can only say that if there is just one combination
    74.         If P_knows(I * (Sum - I)) = False Then
    75.        
    76.             If P_knows_now(I * (Sum - I)) Then t = t + 1
    77.         End If
    78.         If t > 1 Then Exit For                          'no need to check futher
    79.     Next I
    80.    
    81.     S_knows_now = t = 1
    82.            
    83. End Function
    84.  
    85. Private Sub Form_Load()
    86.     Dim a As Long, b As Long
    87.    
    88.     For b = 2 To 98
    89.         For a = 2 To 98
    90.             If a = 2 And b = 6 Then Stop
    91.             If a + b < 100 Then
    92. '               Debug.Print a; b,
    93.                 If Not P_knows(a * b) Then
    94. '                   Debug.Print "P knows not",
    95.                     If S_knows_that(a + b) Then
    96. '                       Debug.Print "S knows that",
    97.                         If P_knows_now(a * b) Then
    98. '                           Debug.Print "P knows now",
    99.                             If S_knows_now(a + b) Then
    100. '                               Debug.Print "S knows now",
    101.                                 MsgBox Format(a) + ", " + Format(b)
    102.         End If: End If: End If: End If: End If
    103. '       Debug.Print
    104. '       DoEvents
    105.     Next a, b
    106.  
    107. End Sub

    The good people at microsoft say it is 4,13 :http://research.microsoft.com/aboutm...ns/2_XandY.htm

    I think 2 and 6 work.

    P = 12, S = 8

    P => 12 = 3x4, 2x6 - so he doesn't know
    S => 8 = 2+6, 3+5, 4+4 - so he doesn't know

    P now knows because it can't be 3x4, if it was 3x4, the sum is 7
    7 => 2+5, 3+4 But it can't be 2+5 or 3+4 because the Product guy would have known.

    Now the Sum guy knows because it can't be 3+5. That is 15 and the Product guy would have know the first time. It also can't be 4+4, bacause the Product still wouldn't know. So it is 2,6
    My secretary hopes that I will pay her, her landlord hopes that she will produce some rent, the Electricity Board hopes that he will settle their bill, and so on. I find it a wonderfully optimistic way of life. [Dirk Gently]

  6. #6
    Frenzied Member zaza's Avatar
    Join Date
    Apr 2001
    Location
    Borneo Rainforest Habits: Scratching
    Posts
    1,486

    Re: If you can solve this your a genius

    Two points:

    1) The question given in post #1 and the one on the Microsoft page to which you have linked are not the same.

    2) In your example, the fact that Y says that he knows X doesn't know does not then allow X to deduce what the numbers are.
    I use VB 6, VB.Net 2003 and Office 2010



    Code:
    Excel Graphing | Excel Timer | Excel Tips and Tricks | Add controls in Office | Data tables in Excel | Gaussian random number distribution (VB6/VBA,VB.Net) | Coordinates, Vectors and 3D volumes

  7. #7
    Addicted Member Glaysher's Avatar
    Join Date
    Jul 2006
    Posts
    132

    Re: If you can solve this your a genius

    Quote Originally Posted by Yonatan
    Translation:
    I know mn, but from my knowledge of mn and this knowledge alone, it is impossible to deduce what m+n is.
    X has 52 but m + n could be 4 + 13 = 17 or 2 + 26 = 28
    Translation:
    I know m+n, and from this knowledge I have been able to deduce that it is impossible to know m+n by just knowing mn.
    Y has 17 and knows that every addition m + n that can make 17 gives an mn which could be found by multiplying together two different numbers (property 1)
    Translation:
    I know mn, and I know that it should be impossible for me to find out m+n, but there is only one sum of two integers between 2 and 100 which make this impossible (which Yonatan didn't figure out yet), so I now know this sum!
    Y couldn't have 28 because I could have 23 and 5 which are both primes and in that case I would know what m + n is, therfore Y has 17
    Translation:
    Well, you figured them out! That means with your knowledge of mn and your knowledge that it's impossible to find m+n, there is only one possible sum - and with my knowledge of the sum and the knowledge that you have been able to figure it out, I have deduced that there is only one possible product, which I now know!
    Out of my possibilities all but one could lead to another number similar to 17 (has property 1)
    So if you know my number m and n must be 4 and 13 and therefore you have 52




    Solution needs checking!
    Last edited by Glaysher; Dec 20th, 2006 at 09:33 AM.
    Vaiyo A-O
    A Home Va Ya Ray
    Vaiyo A-Rah
    Jerhume Brunnen G
    Vaiyo A-Rah
    Jerhume Brunnen G

  8. #8
    Fanatic Member THEROB's Avatar
    Join Date
    Oct 2000
    Location
    I'm cold and there are wolves after me
    Posts
    575

    Re: If you can solve this your a genius

    Quote Originally Posted by Glaysher
    Y couldn't have 28 because I could have 23 and 5 which are both primes and in that case I would know what m + n is, therfore Y has 17
    Yes but P knows he has 52, S can still have 28 which was made up from 2+26, 3+25, 4+24, 6+22, 7+21, 8+20, 9+19, 10+18 ...
    My secretary hopes that I will pay her, her landlord hopes that she will produce some rent, the Electricity Board hopes that he will settle their bill, and so on. I find it a wonderfully optimistic way of life. [Dirk Gently]

  9. #9
    Frenzied Member zaza's Avatar
    Join Date
    Apr 2001
    Location
    Borneo Rainforest Habits: Scratching
    Posts
    1,486

    Re: If you can solve this your a genius

    Quote Originally Posted by THEROB
    Yes but P knows he has 52, S can still have 28 which was made up from 2+26, 3+25, 4+24, 6+22, 7+21, 8+20, 9+19, 10+18 ...

    But the point is that S knows that P doesn't know. He is certain of the fact. He couldn't be certain if there was the possibility that the number in question could be made up of two primes.

    In the instance below, if S had 28 then P could have 23 x 5 = 115, and if P had been given 115 then he would know what m+n was. Hence if S had 28, he couldn't be sure that P didn't already know what the two numbers were.
    I use VB 6, VB.Net 2003 and Office 2010



    Code:
    Excel Graphing | Excel Timer | Excel Tips and Tricks | Add controls in Office | Data tables in Excel | Gaussian random number distribution (VB6/VBA,VB.Net) | Coordinates, Vectors and 3D volumes

  10. #10
    Addicted Member Glaysher's Avatar
    Join Date
    Jul 2006
    Posts
    132

    Re: If you can solve this your a genius

    Quote Originally Posted by zaza
    But the point is that S knows that P doesn't know. He is certain of the fact. He couldn't be certain if there was the possibility that the number in question could be made up of two primes.

    In the instance below, if S had 28 then P could have 23 x 5 = 115, and if P had been given 115 then he would know what m+n was. Hence if S had 28, he couldn't be sure that P didn't already know what the two numbers were.
    Exactly and I have checked the solution though have not proved it's unique as that will be time consuming without a computer
    Vaiyo A-O
    A Home Va Ya Ray
    Vaiyo A-Rah
    Jerhume Brunnen G
    Vaiyo A-Rah
    Jerhume Brunnen G

  11. #11
    Hyperactive Member
    Join Date
    Aug 2006
    Posts
    367

    Re: If you can solve this your a genius

    So basically if the sum given to Y can be expressed as the sum of two primes then that sum is excluded from the set of possible values satisfying the situation..
    So math guy X looks at his product and considers the possible sum of its factors.. If one of those sums could not 'possibly' be expressed as a sum of 2 primes (eg 2+7=9) then he takes special note of that thought because it is actually a pretty rare condition..
    Now math guy Y slips the info that this rare condition is actually fulfilled by his sum, tipping off math guy X that the factoral sum he took special note of is indeed valid..
    Meanwhile, math guy Y had taken special note that for one of the possible products, none of one of the possible sumations adding to his number could be expressed as the sum of two primes (the same rare condition)..
    So when math guy X shoots off his mouth that he had the problem solved, he confirms to math guy Y that the special possible product he had taken note of was the only possible product X could have..

    Edit: The true flaw in the logic I figure is the fact that one must assume another person has not made a mistake... Thats something I never like to do..
    Last edited by triggernum5; Dec 24th, 2006 at 10:46 AM.

  12. #12
    Addicted Member Glaysher's Avatar
    Join Date
    Jul 2006
    Posts
    132

    Re: If you can solve this your a genius

    Sounds right.

    Of course you have to assume X and Y are all knowing and logically sound
    Vaiyo A-O
    A Home Va Ya Ray
    Vaiyo A-Rah
    Jerhume Brunnen G
    Vaiyo A-Rah
    Jerhume Brunnen G

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width