All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Logic > Liars and Knights
Arm Appraisal II (Posted on 2012-12-03) Difficulty: 3 of 5
A distant planet is inhabited by creatures having more than two arms. The ones with an even number of arms are the knights who always tell the truth; the ones with an odd number of arms are the liars who always speak falsely.

The rules of the planet allow only creatures having eight, nine or ten arms to work as guards. Four guards are conversing amongst themselves:
  • The magenta one says, "All together we have 39 arms."
  • The cyan one says, "No, we do not."
  • The brown one says, "The beige one has 8 arms."
  • The beige one says, "The brown one is lying."
Determine the number of arms of each guard.

See The Solution Submitted by K Sengupta    
Rating: 3.0000 (2 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solutions | Comment 1 of 2

FOR magenta = 8 TO 10
FOR cyan = 8 TO 10
FOR brown = 8 TO 10
FOR beige = 8 TO 10
   good = 1
   tot = magenta + cyan + brown + beige
   IF (magenta <> 9) <> (tot = 39) THEN good = 0
   IF (cyan <> 9) <> (tot <> 39) THEN good = 0
   IF (brown <> 9) <> (beige = 8) THEN good = 0
   IF (beige <> 9) <> (brown = 9) THEN good = 0
 
   IF good THEN
     PRINT magenta; cyan; brown; beige
   END IF
NEXT
NEXT
NEXT
NEXT

finds

 9  8  9  10
 9  10  9  10
 
as alternate solutions for the number of arms of magenta, cyan, brown and beige respectively.
 
Either way, cyan is telling the truth that magenta is lying, as in one case they have 36 arms all together and in the other case 38.


  Posted by Charlie on 2012-12-03 17:58:07
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (1)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (6)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information