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.)
 Solution based on the O-Sort sorting algorithm | Comment 11 of 20 |
The O-Sort is a diminishing increment sorting algorithm that starts with a step size 1 smaller than 1/2 the length of items to be sorted.

Calling the coin positions A, B, C, D, and E, the sequence of comparisons (weighings) would be as follows(after each comparison the lighter coin would be placed closer to A and the heavier coin closer to E):

1. A, C
2. B, D
3. C, E

(the step size decrements here)

4. A, B
5. B, C
6. C, D
7. D, E

This sequence guarantees a solution.

 Posted by Erik on 2004-06-01 16:50:29

 Search: Search body:
Forums (0)