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

Home > Logic
Musicians (Posted on 2014-02-19) Difficulty: 3 of 5
Elfum and four of his friends- Ekum, Epum, Eskum and Evum gathered together frequently to play their musical instruments. One played a flute, one played a horn, one played a drum, one played a gourd instrument and one played a lyre (albeit not necessarily in that order.)

Each of four of the five friends lived near one of the others. It is known that:
  1. The one who played the flute lived next door to Eskum.
  2. Epum lived adjacent to the one who played the lyre, who was not Eskum.
  3. Evum, who did not play the drum, did not live near the one who played the flute.
  4. The one who played the horn and the one who played the flute, who was not Ekum, were neighbors.
  5. Ekum did not play the gourd or the drum.
From the above statements, determine who played which instrument and who lived near which of the others.

No Solution Yet Submitted by K Sengupta    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Some Thoughts Is this it? | Comment 1 of 6

The list below shows possible sequences, with first entry on the first line lower alphabetically than the last entry on that line, the second letter of the player on the first line and the first letter of the instrument on the second line.

To resolve the issue of Evum not living near the flute player (how far is considered "not near"), the distance is shown also on the second line.

Only in two instances are they as far apart (4 doors) as possible:

Elfum flute player
Eskum horn player
Ekum  lyre player
Epum  drum player
Evum  gourd player

Elfum flute player
Eskum horn player
Epum  drum player
Ekum  lyre player
Evum  gourd player

 

lkpsv
dlfhg          2
lskpv
fhldg          4
lspkv
fhdlg          4
lspkv
dhflg          2
lsvkp
fhgld          2
lvkps
dglfh          2
pklsv
dlfhg          2
pvkls
glhfd          2
pvkls
dlhfg          2
slkpv
gfhdl          3
slkpv
hfldg          3
slkpv
dfhgl          3
slpkv
hfdlg          3
slpkv
dfhlg          3
spklv
hfldg          3
klspv
hfdgl          3
klspv
hfgdl          3
klsvp
hfdlg          2
klsvp
hfgld          2
kplsv
ldfhg          2
kplsv
lhfdg          2
kpslv
lfhdg          3
kpsvl
lfhgd          2
kpvsl
ldghf          2

Of course it might be the case that they don't even live on the same block; then the problem becomes 2-dimensional and I'd assume that even more possibilities could exist.

DECLARE SUB permute (a$)
OPEN "musicns.txt" FOR OUTPUT AS #2
CLS
nm$ = "lkpsv": hn$ = nm$
DO
ins$ = "fhdgl": hi$ = ins$
DO
  good = 1
  flute = INSTR(ins$, "f")
  Eskum = INSTR(nm$, "s")
  IF ABS(flute - Eskum) <> 1 THEN good = 0
  Epum = INSTR(nm$, "p")
  lyre = INSTR(ins$, "l")
  IF ABS(Epum - lyre) <> 1 OR lyre = Eskum THEN good = 0
  Evum = INSTR(nm$, "v")
  drum = INSTR(ins$, "d")
  IF Evum = drum THEN good = 0
  IF ABS(Evum - flute) <= 1 THEN good = 0
  horn = INSTR(ins$, "h")
  IF ABS(horn - flute) <> 1 THEN good = 0
  Ekum = INSTR(nm$, "k")
  IF Ekum = flute THEN good = 0
  gourd = INSTR(ins$, "g")
  IF Ekum = gourd OR Ekum = drum THEN good = 0
  IF good THEN
   IF LEFT$(nm$, 1) < RIGHT$(nm$, 1) THEN
     PRINT nm$
     PRINT ins$, ABS(Evum - flute)
     PRINT
     PRINT #2, nm$
     PRINT #2, ins$, ABS(Evum - flute)
     PRINT #2,
     ct = ct + 1
   END IF
  END IF

  permute ins$
LOOP UNTIL ins$ = hi$
  permute nm$
LOOP UNTIL nm$ = hn$

PRINT ct

Edited on February 20, 2014, 6:23 pm
  Posted by Charlie on 2014-02-20 18:22:35

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 (22)
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