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

Home > Logic
Widow Surmise (Posted on 2013-12-12) Difficulty: 3 of 5
Four women -- April, Bella, Cara, and Denise -- and three men -- Edwin, Frank, and Gary -- play bridge, a card game for four players.
  1. The men and women consist of three married couples and a widow.
  2. The members of each married couple are never partners in a bridge game.
  3. No more than one married couple ever plays in the same bridge game.
One night they played four bridge games in which the partners were as follows:
   Partners	                  	   Partners
April and Edwin          versus          Bella and Frank
April and Gary           versus          Denise and Frank
Bella and Cara           versus          Frank and Gary
Cara and Edwin           versus          Denise and Gary
Who is the widow?

See The Solution Submitted by K Sengupta    
Rating: 4.0000 (1 votes)

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

DECLARE SUB permute (a$)
CLS
PRINT "EFGw"
DATA aebf,agdf,bcfg,cedg
a$ = "abcd": h$ = a$
husb$ = "efgw"
' for sequence of husbands: e,f,g,widow
DO
  RESTORE
  good = 1
  FOR game = 1 TO 4
    READ lineup$
    ix = INSTR(a$, MID$(lineup$, 1, 1))
    ixp = INSTR(husb$, MID$(lineup$, 2, 1))
    IF ix = ixp THEN good = 0: EXIT FOR
    ix2 = INSTR(a$, MID$(lineup$, 3, 1))
    ixp2 = INSTR(husb$, MID$(lineup$, 4, 1))
    IF ix2 = ixp2 THEN good = 0: EXIT FOR

    IF good THEN
      men$ = "": women$ = ""
      FOR i = 1 TO 4
        IF MID$(lineup$, i, 1) <= "d" THEN women$ = women$ + MID$(lineup$, i, 1)
        IF MID$(lineup$, i, 1) >= "e" THEN men$ = men$ + MID$(lineup$, i, 1)
      NEXT
      IF LEN(women$) = 2 THEN
        hct = 0
        w = INSTR(a$, LEFT$(women$, 1)): hu$ = MID$(husb$, w, 1)
        IF INSTR(men$, hu$) > 0 THEN hct = hct + 1
        w = INSTR(a$, RIGHT$(women$, 1)): hu$ = MID$(husb$, w, 1)
        IF INSTR(men$, hu$) > 0 THEN hct = hct + 1
        IF hct = 2 THEN good = 0
      END IF
    END IF
    IF good = 0 THEN EXIT FOR

  NEXT game
  IF good THEN PRINT a$
  permute a$
LOOP UNTIL a$ = h$


finds

EFGw
dabc

where the top row shows the husband's initials (and a widow position), and the wive's initials appear below each one's husband's, or state of widowhood.

Cara is the widow.


  Posted by Charlie on 2013-12-12 17:51:21
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 (5)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

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