home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / prolog / 2101 < prev    next >
Encoding:
Internet Message Format  |  1992-11-18  |  1.5 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!agate!doc.ic.ac.uk!uknet!edcastle!aiai!ken
  2. From: ken@aiai.ed.ac.uk (Ken Johnson)
  3. Newsgroups: comp.lang.prolog
  4. Subject: Re: PROLOG puzzle frameworks
  5. Message-ID: <7932@skye.ed.ac.uk>
  6. Date: 18 Nov 92 12:27:53 GMT
  7. References: <721442885.F00001@ocitor.fidonet>
  8. Followup-To: comp.lang.prolog
  9. Organization: William's Wonderful Wonky Widget Warehouse
  10. Lines: 40
  11.  
  12.  
  13.  
  14. In a message originally to All, atrium!sysop asked for:
  15.  
  16. #  Logic puzzles such as those posed by Dell's Official Pencil Puzzles and
  17. #  Word Games.  You know, those puzzles that seem to appear on those
  18. #  intelligence or Mensa quizzes. 
  19.  
  20.  
  21. Here's one I got from Dr. Peter Ross here:
  22.  
  23.  
  24. ***  The Mr S and Mr P Problem, by David Warren
  25.  
  26. There are two numbers M and N such that 1 < M & N < 100.  Mr S is told
  27. their sum S and Mr P is told their product P.  The following dialogue
  28. takes place:
  29.  
  30.     Mr P: I don't know the numbers. 
  31.  
  32.     Mr S: I knew you didn't know them; I don't know them either. 
  33.  
  34.     Mr P: Now I know the numbers!
  35.  
  36.     Mr S: Now I know them too!
  37.  
  38. Question: What are the numbers?
  39.  
  40. Ken Johnson comments:
  41.  
  42.             genius(X) :-
  43.                 solves(mr_s_and_mr_p_puzzle,X).
  44.  
  45.  
  46.  
  47. -- 
  48.                                    //// Ken Johnson, A I Applications Institute
  49. CNS server brain not responding   ////       80 South Bridge, EDINBURGH EH1 1HN
  50. ... still trying                 ////                  E-mail ken@aiai.ed.ac.uk
  51.                                 ////       Phone 031-650 2756  Fax 031-650 6513
  52.