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

Home > Logic
Killer and Victim (Posted on 2012-08-26) Difficulty: 3 of 5
The sisters of Aaron Green were Betty and Clara; the name of Aaron's girlfriend was Flora Brown and, Duane and Edwin were Flora’s brothers. Their occupations were as follows:
  • Aaron was a doctor.
  • Betty was a doctor.
  • Clara was a lawyer.
  • Duane was a doctor.
  • Edwin was a lawyer.
  • Flora was a lawyer.
One of the six killed one of the other five. Here are some clues to the murder.
  1. If the killer and the victim were related, the killer was a man.
  2. If the killer and the victim were not related, the killer was a doctor.
  3. If the killer and the victim had the same occupation, the victim was a man.
  4. If the killer and the victim had different occupations, the victim was a woman.
  5. If the killer and the victim were of the same sex, the killer was a lawyer.
  6. If the killer and victim were different sexes, the victim was a doctor.
Who was the killer? Who was the victim?

See The Solution Submitted by K Sengupta    
Rating: 4.6667 (3 votes)

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

DIM related(2) AS STRING, male AS STRING, prof AS STRING, names AS STRING
related(1) = "abc": related(2) = "def"
male = "ade"
prof = "ddldll"   ' in abcdef order
names = "abcdef"

FOR killer = 1 TO 6
FOR victim = 1 TO 6
 IF killer <> victim THEN
  k$ = MID$(names$, killer, 1)
  v$ = MID$(names$, victim, 1)
  rel = 0
  FOR i = 1 TO 2
    IF INSTR(related(i), k$) > 0 AND INSTR(related(i), v$) > 0 THEN rel = 1
  NEXT
  IF INSTR(male, k$) > 0 THEN kman = 1:  ELSE kman = 0
  IF rel = 0 OR kman = 1 THEN
    kprof$ = MID$(prof, killer, 1)
    IF rel = 1 OR kprof$ = "d" THEN
      vprof$ = MID$(prof, victim, 1)
      IF INSTR(male, v$) > 0 THEN vman = 1:  ELSE vman = 0
      IF kprof$ <> vprof$ OR vman = 1 THEN
        IF kprof$ = vprof$ OR vman = 0 THEN
           IF kman <> vman OR kprof$ = "l" THEN
              IF kman = vman OR vprof$ = "d" THEN
               PRINT "killer:"; k$, "victim:"; v$
              END IF
           END IF
        END IF
      END IF
    END IF
  END IF
 END IF
NEXT
NEXT

finds

killer:b      victim:d

so Betty killed Duane.


  Posted by Charlie on 2012-08-26 15:42:50
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 (10)
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