A Question Of Balance

This applet can be used to further explore the behaviour of the partition algorithm demonstrated by the Stevedore Stomp applet.

It lets you increase the number of crates to 1,000,000. More significantly, you can increase the max. crate weight to be in the range 1 - 1,000,000,000 units.

The 'LOAD NEW CARGO' button is used to fairly evenly load a new cargo, using the values that you have typed into 'MAX.CRATE WEIGHT' and 'NUMBER OF CRATES'. A starting position is shown as the total crate weight and number of crates in each hold, and the weight difference between the two holds.

When 'BALANCE CARGO' button is pressed, the applet balances the crates by moving them from one hold to the other, until the difference is reduced to 0 or 1, or until you feel you've given it enough time. It always starts from the same loaded position, but will develop a different course towards its goal, and will usually end up with a different combination.

The process stops every 10,000,000 iterations, or when it has the cargo balanced. In the former case a 'CONTINUE' button appears. You can use this to continue from the point that process was interrupted,....or you can press the 'BALANCE CARGO' to restart from the load position.

'STOMP' is the degree to which the applet is directed towards its goal. At 0 it shuffles the crates haphazardly; at 100 it is completely focussed....or you might say blinkered. You can set it to any value 0-100.

Notes

Here are some statistics to keep in mind if the applet doesn't seem to be getting anywhere......

Number of crates Time required to review all the ways of dividing them between the 2 holds
20 1 second
30 20 minutes
40 12 days
50 35 years
60 37,000 years
70 37,000,000 years
80 twice the age of the universe
1,000,000 a very large incomprehensible number of the largest units of measure that you can comprehend.

 

Return to main page.