It's been a while since I looked at this, and I've forgotten what's going on.
Whenever k>0, we have the formula:
U(n,m,k) = m/n * U(n-1,m-1, k-1) + (n-m)/n U(n-1, m, k-1)
This lets us kill them separately, so the probability formulas are irrelevent.
All we need is a formula for U(n, m, 0). So we have n AI, m of which are evil, and each evil guy kills one other guy at random. The process is as follows:
Reduce n and m by 1.
Kill one guy at random.
Add 1 to n and m.
Repeat for every evil guy.
I wrote:Maybe we need a new variable to keep track of how many murders we've had.
Let's try this. We'll define a new function P(n,m,d) where d is the number of deaths we've had. This starts at 0, and increases to m. Once we get to m, we start the next turn.
note that U(n,m,0) = P(n,m,m)
If d < m
P(n,m,d) = (m-1)/(n-1) * P(n-1,m-1,d+1) + (n-m)/(n-1) * P(n-1,m,d+1)
If d = m, then we end the turn, so P(n,m,m) = V(n,m).
Here's our final set of rules. We need a lot of initial conditions.
V[n, m] = Max[Table[U[n, m, k], {k, 0, n}]]
V[0, m] = 0
U[0, m, k] = 0
U[1, m, 0] = 1
U[1, m, 1] = 0
U[n, 0, k] = n - k
U[n, m, k] = If[n > 0 && m > 0 && k > 0,
(m/n) U[n - 1, m - 1, k - 1] + (n - m)/n U[n - 1, m, k - 1]])
U[n, m, 0] = P[n, m, m]
P[n, 0, d] = n
P[1, m, 0] = 1
P[1, m, d] = 0
P[n, m, 0] = V[n, m]
P[n, m, d] = (m-1)/(n-1) P[n-1, m-1, d-1] + (n-m)/(n-1) P[n-1, m, d-1]
When I plugged this into mathematica, I got a different answer for GGEE k0. The new formula gives 1 instead of 10/9. We should look at this one more carefully.