 All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars  perplexus dot info  Rank The Magicians (Posted on 2007-05-08) Six magicians A, B, C, D, E, F live in an island. Every Monday, the elders of the island rank the six magicians on their performance during the previous six days.

The rankings published on the previous Monday listed A 1st, B 2nd, C 3rd, D 4th, E 5th and F 6th.

This Monday’s ranking has each magician ranked in a different position than that of the previous Monday. We know that:

1. B’s change in ranking is greatest among the six magicians.

2. The product of D’s rankings for the two weeks is the same as the product of F’s rankings for the two weeks.

Determine the new rankings.

 See The Solution Submitted by K Sengupta Rating: 2.6000 (5 votes) Comments: ( Back to comment list | You must be logged in to post comments.) of course there's a computer solution also | Comment 3 of 8 | (In reply to solution by Charlie)

DECLARE SUB permute (a\$)
CLS
a\$ = "abcdef": h\$ = a\$
DO
good = 1
FOR i = 1 TO 6
IF MID\$(a\$, i, 1) = MID\$(h\$, i, 1) THEN good = 0: EXIT FOR
NEXT
IF good THEN
ac = ABS(INSTR(a\$, "a") - INSTR(h\$, "a"))
bc = ABS(INSTR(a\$, "b") - INSTR(h\$, "b"))
cc = ABS(INSTR(a\$, "c") - INSTR(h\$, "c"))
dc = ABS(INSTR(a\$, "d") - INSTR(h\$, "d"))
ec = ABS(INSTR(a\$, "e") - INSTR(h\$, "e"))
fc = ABS(INSTR(a\$, "f") - INSTR(h\$, "f"))
IF bc > ac AND bc > cc AND bc > dc AND bc > ec AND bc > fc THEN
d = INSTR(a\$, "d")
f = INSTR(a\$, "f")
IF 6 * f = 4 * d THEN
PRINT a\$
END IF
END IF
END IF

permute a\$
LOOP UNTIL a\$ = h\$

also produces

caefbd

 Posted by Charlie on 2007-05-08 21:30:26 Please log in:

 Search: Search body:
Forums (0)