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

 Yet one more coin sorting problem (Posted on 2004-05-31)
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?

 See The Solution Submitted by Federico Kereki Rating: 4.0000 (4 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
 re: Solution based on the O-Sort sorting algorithm | Comment 12 of 20 |
(In reply to Solution based on the O-Sort sorting algorithm by Erik O.)

Suppose A is the heaviest and E is the lightest, so you've got EDCBA. After your steps you get, since this is positional and A, C means first position vs 3rd position,

1. CDEBA
2. CBEDA
5. BACDE
6. BACDE
7. BACDE, which is still not ordered.

In the actual sort algorithm, each sort span must be iterated all the way through (I thought this was called a shell sort actually) until no flips take place through an entire sweep, especially at the end with increment of 1.

If they are not positional, then step 3 will produce a 10-20 split in the 30 possibilities that remain after the first two weighings, and if you're unfortunate enough that you fall on the 20 side, they can't be determined by only 4 more weighings.

 Posted by Charlie on 2004-06-02 11:22:26

 Search: Search body:
Forums (0)