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

 Marriage Muse (Posted on 2013-05-03)
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.)
 spoiler | Comment 1 of 4

The following table could have been done by hand:

`Initials       statusA M           violates rule: 4A N           violates rule: 4A O           violates rule: 5A P           violates rules: 4 5B M           answerB N           violates rule: 2B O           violates rule: 5B P           violates rules: 2 5C M           violates rule: 3C N           violates rule: 2C O           violates rule: 3C P           violates rules: 2 3D M           violates rules: 3 4D N           violates rules: 2 4D O           violates rules: 3 5D 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
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),
ELSE
PRINT "violates rule";
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

 Search: Search body:
Forums (1)