You have five coins, apparently alike, but actually of different weights. You also have a two arm scale.
Can you manage to sort the coins in ascending order, using the scale only seven times?
Bonus question: can it be done in fewer weighings?
(In reply to
re(6): Solution based on the O-Sort sorting algorithm by Erik O.)
Your link has a missing / between computer and sortroutines (in the visible verions it has a backslash there, but in the actual link there's nothing there).
I did find that even .81 failed to sort completely, so I doubt .78 would work either.
Of course one could guarantee that it would work if when it reached the step-1 level, that if it found it necessary to swap anything it would go through the step-1 level again, and so on until no swaps were made.
|
Posted by Charlie
on 2004-06-03 22:38:11 |