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

Home > Logic
Marriage Muse (Posted on 2013-05-03) Difficulty: 2 of 5
Four men -- Aaron, Barry, Colin & David and four women -- Marie, Norma, Olive & Pearl -- attended a wedding.
  1. One of the four men married one of the four women.
  2. If neither Aaron nor Marie got married, then Olive got married.
  3. If neither Aaron nor Norma got married, then Barry got married.
  4. If neither Barry nor Olive got married, then Colin got married.
  5. If neither Colin nor Norma got married, then Marie got married.
Who got married?

No Solution Yet Submitted by K Sengupta    
Rating: 2.0000 (1 votes)

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

The following table could have been done by hand:

Initials       status
A M           violates rule: 4
A N           violates rule: 4
A O           violates rule: 5
A P           violates rules: 4 5
B M           answer
B N           violates rule: 2
B O           violates rule: 5
B P           violates rules: 2 5
C M           violates rule: 3
C N           violates rule: 2
C O           violates rule: 3
C P           violates rules: 2 3
D M           violates rules: 3 4
D N           violates rules: 2 4
D O           violates rules: 3 5
D P           violates rules: 2 3 4 5

But was actually produced by

DIM men AS STRING, women AS STRING
CLS

men = "ABCD": women = "MNOP"

FOR m = 1 TO 4
FOR w = 1 TO 4
 bad = 0
 IF m <> 1 AND w <> 1 AND w <> 3 THEN bad = 1
 IF m <> 1 AND w <> 2 AND m <> 2 THEN bad = bad + 2
 IF m <> 2 AND w <> 3 AND m <> 3 THEN bad = bad + 4
 IF m <> 3 AND w <> 2 AND w <> 1 THEN bad = bad + 8

 PRINT MID$(men, m, 1); " "; MID$(women, w, 1),
 IF bad = 0 THEN
   PRINT "answer"
 ELSE
   PRINT "violates rule";
   IF bad = 1 OR bad = 2 OR bad = 4 OR bad = 8 THEN
     PRINT ": ";
   ELSE
     PRINT "s: ";
   END IF
   IF bad AND 1 THEN PRINT "2 ";
   IF bad AND 2 THEN PRINT "3 ";
   IF bad AND 4 THEN PRINT "4 ";
   IF bad AND 8 THEN PRINT "5 ";
   PRINT
 END IF
NEXT
NEXT


  Posted by Charlie on 2013-05-03 12:39:18
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (0)
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