Lets say I have $4$ separate quantities ($n_1, n_2, n_3, n_4$), whose total sum is $1000$.
I must achieve a state where $1$ quantity contains the entire sum and the other $3$ quantities are $0$.
The method which I can apply to change the quantities is as follows: I select $2$ of the quantities and a value between $1$ and $100$ (which cannot be greater than the current "quantity of either of the two selected). That quantity will now be added to the current quantity of one, and subtracted from the other. Which balance will receive the addition and which will receive the deduction has a $50$% chance of going either way?
OBJECTIVE: Find the sequence of moves which minimizes the expected number of steps taken.
Here's a random concrete example to clarify what i mean.
Let's say my $4$ quantities end up being $400, 500, 90$ and $10$. For decision $1$, for example, let's say I pick the balances of $90$ and $10$, and choose the quantity $10$. There is a $50:50$ split between my outcome being $80$ and $20$, or $100$ and $0$. If it is $100$ and $0$, I take that as a good thing because that means I have permanently eliminated $1$ quantity, but if it ends up $80:20$ then it's as if I am taking a step backwards.
I suspect that there's no easy formula to plug this into and that I might need computer assistance. However there might exist some simple rules or axioms that could easily guide/automate my decision making process.
That being said, at the end of the day I have no idea how I should go about achieving this or where I would even start (in terms of either solving this, software to use, or how to use it).
My ideal implementation would be generalizable to $N$ quantities (not specifically $4$), and would allow me to plug in the individual quantity values and get the steps I should take to achieve the result as described above.