Output #1
6
The movements from time $t=0$ to $t=1$ are determined as follows. (Refer to the diagram below if necessary.)
> 1. For ball $3$, its position at $t=1$ has not yet been determined. The cell immediately below it contains ball $1$, and ball $3$ is heavier, so swap their positions for $t=1$. That is, set the position of ball $3$ to cell $3$, and ball $1$ to cell $2$.
> 2. For ball $2$, its position at $t=1$ has not yet been determined. The cell immediately below it contains ball $3$, which is heavier than ball $2$, so set the position of ball $2$ at $t=1$ to be the same as at $t=0$.
> 3. For ball $1$, its position at $t=1$ has already been determined in the earlier step.
> 4. For balls of weight $0$, none of their positions at $t=1$ have been determined. Set their positions at $t=1$ to be the same as at $t=0$.
Next, the movements from time $t=1$ to $t=2$ are determined as follows.
> 1. For ball $3$, its position at $t=2$ has not yet been determined. The cell immediately below it contains ball $0$, and ball $3$ is heavier, so swap their positions for $t=2$. That is, set the position of ball $3$ to cell $4$, and ball $0$ (the one that was below ball $3$) to cell $3$.
> 2. For ball $2$, its position at $t=2$ has not yet been determined. The cell immediately below it contains ball $1$, and ball $2$ is heavier, so swap their positions for $t=2$. That is, set the position of ball $2$ to cell $2$, and ball $1$ to cell $1$.
> 3. For ball $1$, its position at $t=2$ has already been determined in the earlier step.
> 4. For balls of weight $0$, the one that was at cell $4$ at $t=1$ has already had its position at $t=2$ determined in the earlier step. For the others, set their positions at $t=2$ to be the same as at $t=1$.
Continuing to determine the positions of the balls in this way, at time $t=6$, the balls will be arranged from top to bottom as balls $0,0,0,1,2,3$, and their positions will no longer change.
