
July 8th, 2011, 01:33 PM
|
 |
Still alive
|
|
Join Date: Mar 2007
Location: Washington, USA
|
|
That's it, actually: take from the most and give to the least.
Code:
3 1 4 1 5 9 2 6 5
^ ^
3 4 4 1 5 6 2 6 5
^ ^
3 4 4 4 5 3 2 6 5
^ ^
3 4 4 4 5 3 4 4 5
^ ^
4 4 4 4 4 3 4 4 5
^ ^
4 4 4 4 4 4 4 4 4
Given M=the number of urns that need adjustment, the lower bound on the number of moves is ceil(M/2) (1 3 1 3) and the upper bound is M-1 (1 1 1 5).
|