Xref: utzoo comp.databases:6859 rec.puzzles:6427 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!wuarchive!husc6!encore!pinocchio.encore.com From: jkenton@pinocchio.encore.com (Jeff Kenton) Newsgroups: comp.databases,rec.puzzles Subject: Re: SQL puzzle Message-ID: <12518@encore.Encore.COM> Date: 17 Aug 90 15:01:15 GMT References: <125@guug.guug.de> Sender: news@Encore.COM Followup-To: comp.databases Lines: 47 From article <125@guug.guug.de>, by greil@guug.guug.de (Anton Greil): > > Can you solve the following puzzle by SQL? > > "Here is an arithmetical problem which is belonging to the great > classics. Two natural numbers were selected which are greater > than 1 and less than 100. The sum of these two numbers was told > Mr. S, the product of the numbers was told Mr. P. > > Each of the two men doesn't know the number of the other. Mr. P > rings up Mr. S: > > P: I can't find the two numbers. > S: I knew, that you would not succeed. > P: Oh ... But now, I know them! > S: In this case, I know them too." > The two numbers are 3 and 14. Solved by following the clues: > P: I can't find the two numbers. Therefore, the PRODUCT has at least 3 prime factors, all less than 50. > S: I knew, that you would not succeed. Therefore, all decompositions of the SUM into two numbers must produce a product which satisfies the condition above. This leaves 11, 17, 23, 27, 29, 35, 41, 47 and 51. > P: Oh ... But now, I know them! Therefore, of all the factorings of the PRODUCT into two numbers, in only one case is the sum of those numbers in the list above. > S: In this case, I know them too." Therefore, of all decompositions of the SUM into two numbers exactly one produces a product which, when factored into pairs of numbers, has only one of those pairs whose sum is in the list above. Only the sum 17 satisfies this last condition (with the pair 4 + 13). - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - jeff kenton --- temporarily at jkenton@pinocchio.encore.com --- always at (617) 894-4508 --- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -