[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference rusure::math

Title:Mathematics at DEC
Moderator:RUSURE::EDP
Created:Mon Feb 03 1986
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2083
Total number of notes:14613

576.0. "Who is the Spy? [R. Smullyan]" by 26205::YARBROUGH () Fri Sep 12 1986 15:00

This puzzle is from Raymond Smullyan's book, "Alice in Puzzleland". It is
NOT the toughest puzzle in the book. 

The puzzle takes place in a land populated solely by Knights (who always 
speak the truth) and Knaves (who always lie). A spy (who may say anything
he chooses) entered the land; he was captured along with a Knight and a 
Knave, but only they knew which was which. The three men (call them A, B, 
and C) were brought before a judge (who was a Knight, incidentally), whose
job was to determine which of the three was the spy. 

The judge asked A, "Are you the spy?", and A answered either "yes" or "no".
The judge then asked B, "Did A tell the truth?", and B answered either 
"yes" or "no". 

At this point, A volunteered, "C is not the spy!" The judge replied, "I 
already figured that out, and now I know who the spy is."

Which (of A and B) is the spy? What is each of the other two?
T.RTitleUserPersonal
Name
DateLines
576.1AnswerCHOVAX::YOUNGI think we're all bozos on this BUS.Fri Sep 12 1986 16:4917
    Judge (To A): Are you the spy?
    
     A: No.
    
    Judge (To B): Are you the spy?
    
     B: No.
    
    (The Judge now knows that C must be the knave.)
    
     A: C is not the spy.
    
    
    Therefore A must be the spy, and B must be the knight.
    
    -- Barry
    
576.2no, noGALLO::JMUNZERFri Sep 12 1986 17:188
	Re .1:
    
    	But (no, no) can come from (A = Knight, B = Knave, C = Spy).

	So the judge can't conclude from (no, no) that C = Knave.

	
	John
576.3This is the truthSMURF::DIKEFri Sep 12 1986 17:1127
    Re .1: The second question was "Did A tell the truth?"
    
    The following table records the possible identities of A, B, and
    C according to the answers that A and B gave to the judge:
    
    Answer
    #1 #2  |   A    |   B    |   C    |
    -------+--------+--------+--------+
     N  N  | Knight | Knave  |  Spy   |   Since the judge already knew
    	   | Knight |  Spy   | Knave  |   that C was not the spy, the
           |  Spy   | Knight | Knave  |   answers must have been NY
    -------+--------+--------+--------+   or YY.  If they were NY, A
     N  Y  | Knight |  Spy   | Knave  |   would be either the knight
           |  Spy   | Knave  | Knight |   or the spy.  Since both are
    -------+--------+--------+--------+   allowed to tell the truth,
     Y  N  | Knave  | Knight |  Spy   |   the judge would not be able
           | Knave  |  Spy   | Knight |   to tell who was the spy from
           |  Spy   | Knave  | Knight |   that extra bit of information.
    -------+--------+--------+--------+   If they were YY, A would be
     Y  Y  | Knave  |  Spy   | Knight |   either the knave or the spy.
           |  Spy   | Knight | Knave  |   Since the knave is not allowed
    -------+--------+--------+--------+   to tell the truth, A must
                                          be the spy.  In addition,
    B is the knight and C is the Knave.
    
    				Jeff
    
576.4...embarrased...CHOVAX::YOUNGI think we're all bozos on this BUS.Fri Sep 12 1986 17:529
    Jeff (.3) is right, I am wrong.
    
    * SIGH *
    
    One of these days I really must learn how to read.
        
    
    Let me make amends with another problem (to follow)...
    
576.5Another Question.CHOVAX::YOUNGI think we're all bozos on this BUS.Fri Sep 12 1986 17:5428
  A king of a land consisting only of knights and knaves, one day asked his
Head Royal Bean Counter to compose a report for him detailing how many 
subjects he had, how many were knights, and how many were knaves.

  After some time here is what his Bean Counter told him:

	There are more knights than knaves.

	The total number of subjects is a composite number.

	The ratio of knaves to knights (knv/knt) is a natural number.

	The number of knaves is less then 120.

	The total number of subjects is greater than the number of
	page table entries in a single page of their computer.

  It took the king only a few seconds to figure out exactly how many
subjects of each type he had.


NOW, assuming that the king was a good DEC customer, (I was there on a 
residency, supporting their VAXcluster, their only computers), how many
of each kind of subject DID the king have?

-- Barry
    
576.6Ummm...SMURF::DIKEFri Sep 12 1986 17:567
Shoot me if I'm being a dolt, but
    
    If there are more knights than knaves,
    Then how can knaves/knights be a natural number?
    
    			Jeff
    
576.7CHOVAX::YOUNGI think we're all bozos on this BUS.Fri Sep 12 1986 18:421
    There is no mistake.
576.8I'd get a new bean counter26205::YARBROUGHMon Sep 15 1986 13:0114
    Hmmm. Obviously the bean-counter is a knave, so the truth of his
    report reads:
    	knv > kni
    	knv+kni = prime
    	knv/kni <> nat no
    	knv >= 120
    	knv+kni <= 128
    So the number of inhabitants must be 127, the only prime in the
    range, but any of the pairs {125,2}, {124,3}, {123,4}, {122,5},
    {121,6} or {120,7} satifies the ratio condition. Now if the ratio
    condition were actually correct as the B.C. reported it, then
    {126,1} would be a unique solution...
    
    No doubt I am missing something.
576.9HintCHOVAX::YOUNGI think we're all bozos on this BUS.Mon Sep 15 1986 20:4811
    Well Lynn, it appears that you have discovered the Head Royal Bean
    Counters secret.
    
    So far you are VERY close, but it seems that you have missed one
    of the valid non-natural ratios in this range.
    
    I might add that the solution also will explain why the king has
    never bothered to get another Head Bean Counter.
                         
    -- Barry
    
576.10Don't see how that helps26205::YARBROUGHTue Sep 16 1986 17:573
    Well, I did overlook {127,0} (my aversion to division by zero is
    THAT strong) but that is just one more solution to add to the six
    I gave above. I don't see a UNIQUE solution.
576.11CHOVAX::YOUNGI think we're all bozos on this BUS.Thu Sep 18 1986 23:3317
    ...Sorry, my net link has been down for a couple of days.
    
    Re .10:
    
    Yes, you are right, Lynn.  In checking my notes I find that I should
    have managed to imply that BOTH the number of knaves, and the total
    number of subjects were prime.  Oh, well.  The correct answer was
    supposed to be {127, 0}, and of course (127/0) is not a natural
    number (it's not any number at all).  I guess this is what I get
    for trying to make up a decent problem over lunch.
    
    Oh, wait!  Maybe I could say that the narrator was also a knave...,
    or maybe a spy...
    
    			-- Barry    Bv)