Optimizing a series of probabilistic addition/subtraction decisions 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.
 A: Here are a few ideas.


*

*if you can find two quantities such that $a=b\leq 100$ then you should pick them and bet $a$ for a 100% chance of reducing the number of quantities by one. 

*if you can find two quantities such that $a\leq b$ and $a\leq 100$ then you should pick them and bet $a$ for a 50% chance of reducing the number of quantities by one. 

*if not, then you should pick another pair and bet 100. My intuition tells me that you should pick first the pairs that are the most likely to eventually lead to the previous case. As pairs with high values of $a$ and $b$ will take longer to disappear (one value goes down to 0), I'd say go first for the pair formed by the two lowest quantities.

*If you only had two quantities, or if you focus on a given pair, then you will almost-surely end up where you want but it could take a very long time (it could take infinitely long with probability 0). Still, it very much looks like a random walk with finite expected number of steps.
This strategy works with any number of quantities.
It would be easy to simulate this, but I have no idea as to how to prove optimality of such a strategy.
