• Welcome! The TrekBBS is the number one place to chat about Star Trek with like-minded fans.
    If you are not already a member then please register an account and join in the discussion!

This weeks maths puzzle

Jadzia

on holiday
Premium Member
Suppose there are two opposing armies (Army 1 and Army 2), of sizes N1 and N2 respectively. Each army consists of equally able soldiers. Each soldier is capable of performing his duty at an average rate of d kills per minute.

Now allow these two armies to meet.

Write down two differential equations for the sizes of the two armies as time varies, and proceed to solve these two equations simultaneously.

Use your solution to predict the percentage of survivors of Army 1, given that Army 1 was twice the size of Army 2 at the beginning of the battle, and how many minutes will pass until the battle is over. :)
 
Percentage of survival for Army 1 is (sqrt(3)/2*100)% or around 86.6%.

Total duration of the battle is 1/2*ln(3) /d minutes. :)
 
Percentage of survival for Army 1 is (sqrt(3)/2*100)% or around 86.6%.

Total duration of the battle is 1/2*ln(3) /d minutes. :)

You worked that out very quick Daed. Yes I think its correct -- It's the answer I got anyway. :bolian: and I hope you did this by hand and not with Mathematica :)

So now what about the general solution if Army 1 is 'a' times the size of Army 2 ??? You may already have seen that these two formulae are tidy, little more complex than the case you did here with a=2.

Use this general solution to determine what value 'a' needs to be, to have 50% of Army 1 surviving the conflict.

I find it interesting how just a small advantage on one side gives a surprisingly biased end result. :) Also if you look at the quotient N1/N2 as time passes, you can see how that advantage amplifies throughout the conflict, beginning from 'a' and rising up to infinity.

So it is imperative to negotiate an advantage as early as possible in a conflict, even if it seems relatively insignificant at the time.
 
I hope you did this by hand and not with Mathematica :)

To be fair I do have the Jordan form of this particular A-matrix memorized. :bolian:

I find it interesting how just a small advantage on one side gives a surprisingly biased end result. :) Also if you look at the quotient N1/N2 as time passes, you can see how that advantage amplifies throughout the conflict, beginning from 'a' and rising up to infinity.

A lot of times the result of differential equations is anything but predictable

So it is imperative to negotiate an advantage as early as possible in a conflict, even if it seems relatively insignificant at the time.

From Sun Tzu to Clausewitz. I think they had this figured out without knowing much mathematics. :)
 
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)


:)
 
BTW Jadzia not that there is anything wrong with the way you solved the problem but this is what I would do (using the Jordan normal form).

jordannormalsa9.jpg



As for rain. Well that would belong to the system modeling problem of the week.
 
Last edited:
If you are not already a member then please register an account and join in the discussion!

Sign up / Register


Back
Top