# Solve game theory equations

Consider simple game:

• Soldiers beat calvary; mages beat soldiers; calvary beat mages;
• We scouted out enemy and now know enemy number of each kind of troops: $Es, Em, Ec;$
• We can send to march the enemy no more than $Tmax$ troops in total;
• We have limited amount of each troop type: $Ps, Pm, Pc;$
• We cannot send more troops than we have, so following conditions must be satisfied: $Xs <= Ps; Xm <= Pm; Xc <= Pc;$

We have to calcuate amount of troops of each type we should send to march to achieve best result.

$Xs=? Xm=? Xc=?$

PS. One solution (maximizing damage) is known and trivial for the case $Ps=\infty, Pm=\infty, Pc=\infty$ if we have unlimited amount of each troop type:

• total enemy troops $Et = Es+Em+Ec$
• soolder to send to march $Xs = Tmax * Ec/Et$
• mage to send $Xm = Tmax * Es/Et$
• calvary to send $Xc = Tmax * Em/Et$

but how to calculate amount of troops to take minimal damage possible? E.g "if there is no soldiers send only calvary"?

also, we have limited troops, and how to achieve best effort? (for example if enemy has many mages, and we have not enough calvary to satisfy best ratio - we should send extra mages but not soldiers. But if we are not capped by march limit $Tmax$ (i mean $Pc+Pm < Tmax$) then we should send soldiers also as they will assist battle anyway) - how to write it in formulas?

• Why in the world would you send more mages in your example? How many battles are being played? – probably_someone Nov 14 '17 at 22:22
• probably_someone, 1 battle is being played. in my example we have many warriors and mages and enemy has pure mages. but we have insuffient calvary to defeat enemy most efficiently. so we should send mages but not warriors as they will deal same amount of damage vs mages, but we will loose more warriors as enemy mages will have extra damage agains them... – xakepp35 Nov 15 '17 at 8:24