Solution
If N1 and N2 are the two variables governing the size of army 1 and 2, then the differential equations governing the conflict are:
N1' = -d.N2
N2' = -d.N1
Basically saying that the rate at which army one is diminished is equal to the size of army two, multiplied by the kill rate of each soldier. And vice versa.
The first of these can be differentiated and substituted into the second, and vice versa:
N1'' = -d.N2' = d^2 . N1
N2'' = -d.N1' = d^2 . N2
Which solve to give:
N1 = A1.Cosh(dt) + B1.Sinh(dt)
N2 = A2.Cosh(dt) + B2.Sinh(dt)
where A1,A2,B1,B2 are arbitrary constants.
Applying the boundary conditions that army 1 is of size S1 at t=0, and army 2 is size S2 at t=0
N1 = S1.Cosh(dt) + B1.Sinh(dt)
N2 = S2.Cosh(dt) + B2.Sinh(dt)
If we differentiate these, the original differential equations allow us to fill in the two remaining constants,
N1' = d.S1.Sinh(dt) + d.B1.Cosh(dt) = -d.N2
N2' = d.S2.Sinh(dt) + d.B2.Cosh(dt) = -d.N1
At t=0,
N1'(0) = -d.S2 = d.B1 => B1 = -S2
N2'(0) = -d.S1 = d.B2 => B2 = -S1
So the solution is:
N1 = S1.Cosh(dt) - S2.Sinh(dt)
N2 = S2.Cosh(dt) - S1.Sinh(dt)
Army 2 is defeated when N2 falls to 0
ie, S2.Cosh(dt) = S1.Sinh(dt)
ie, S2/S1 = Tanh(dt)
Now given that the ratio of the army sizes is a, ie let S1/S2 = a
Let dt = Ln(b), a natural logarithm
Then, 1/a = [exp(dt) - exp(-dt)] / [exp(dt) + exp(-dt)] = [b - 1/b] / [b + 1/b]
ie, 1/a = [b^2 - 1] / [b^2 + 1]
ie, a.[b^2 - 1] = [b^2 + 1]
ie, b^2 [a-1] = [a+1]
ie, b^2 = [(1+a)/(a-1)]
Then the battle is over at time
T = Ln[(a+1)/(a-1)] / 2d
The proportion of Army 1 which survives the battle is N1/S1 at this time T.
N1/S1 = Cosh(dT) - Sinh(dT)/a
We know that dT = ln(b) = Ln[(a+1)/(a-1)]/2
N1/S2 = Cosh(dt) - Sinh(dt)/a
= (1/2).[exp(ln(b)) + exp(-ln(b))] - (1/2).[exp(ln(b)) - exp(-ln(b))]/a
= (1/2).[b + 1/b] - (1/2).[b - 1/b]/a
= [ab + a/b - b + 1/b] / 2a
= [b^2.(a-1) + (a+1)] /2ab
= [(1+a) + (a+1)] / 2ab
= [a+1]/ab
= [(a+1)(a-1)]^(1/2) / a
= [a^2 - 1]^(1/2) / a
= [1-1/a^2]^(1/2)
In the specific case of a=2
The battle is over in time T=Ln[(2+1)/(2-1)]/2d =
Ln(3)/2d minutes
The proportion of survivors of army 1 is [1-1/(2^2)]^(1/2) =
Sqrt[3]/2 ~ 86.6 %
The follow up question, of how to get 50% of Army 1 surviving,
(0.5)^2 = [1-1/a^2]
1/a^2 = 3/4
a = 2/sqrt(3) ~ 1.15
Meaning that if Army 1 has 115 soldiers and Army 2 has 100 soldiers, you expect 50% of army 1 to survive the conflict as Army 2 is destroyed.
Personally I find that a surprisingly biased result for such as small difference in the forces.
The last thing I suggested was to look at Q=N1/N2 over time. If 'a' was the initial advantage that Army 1 had, then this quotient Q measures how that advantage changes throughout the conflict.
Q = N1/N2
N1 = Q.N2
N1' = Q.N2' + Q'.N2
-d.N2 = Q.(-d.N1) + Q'.N2
Q' = d.(N1/N2).Q - d.(N2/N2)
Q' = d.(Q^2 - 1) , which is the differential equation for Q.
which has component solutions tanh(dt) and coth(dt).
Q = N1/N2 = [S1.Cosh(dt) - S2.Sinh(dt)] / [S2.Cosh(dt) - S1.Sinh(dt)]
factoring by S2.cosh(dt) gives a tidier solution
Q = [a - Tanh(dt)] / [1 - a.Tanh(dt)]
or for something easier to visualise, we can reduce it further;
Q = Coth { k - dt }
where constant k = ln(b)
