<< Back to General Forum .GrayedOutTextBox { color: Gray; }

 Posts 1 - 25 of 25
Math Problem II: 6/30/2016 23:33:08

Dutch Desire
Level 59
Report
What is the formula to calculate the minimum amount of armies needed to take a territory with a counterattack?

I need it for a game where I know with how many armies i will be attacked with, at multiple places.

Surcumstancise:
Off. kill rate: 60%
Dif. kill rate: 70%
SR, 0% luck.
one armie stand guard: On

Formula:
D*0,7+(D-A*0,6+1)*0,6=A+1
D= Difensive armie
A= Attacking armie

When 1000 armies attack, then you need to deploy 1047 to take the territory with counterattack.

Edit: When using clamping I get a formula like this: (A+1)*1,046=D

But what is the correct formula?

Edited 7/1/2016 01:19:58
Math Problem II: 6/30/2016 23:41:03

ayy lmao
Level 48
Report

Edited 7/1/2016 00:36:40
Math Problem II: 6/30/2016 23:49:24

Dutch Desire
Level 59
Report
@Wapo, you can't use analyze during the game to calculate the amount of armies needed to take a territory with a counterattack.

@ayy lmao, dont spam ouside the Off-topic forum please.
Math Problem II: 6/30/2016 23:50:35

kynte
Level 51
Report
As far as taking over a territory goes, doesn't it just require two things?:

- all defensive armies are killed

- at least 1 offensive army survives to take the territory

So on face you just need to meet two requirements:

```ROUND(A * .6) >= D
ROUND(D * .7) <= (A-1)
```

Second one simplifies to (A-1) >= ROUND(D * .7), which becomes A >= ROUND(D * .7) + 1.

That second one's only relevant for D = 1, as (D - .5)/.6 < (1 - D * .7) doesn't work for any integer values of D above 1.

So we're really concerned by the first constraint, which becomes (D - .5)/.6 <= A, so you need to just subtract .5 armies (due to the straight rounding) and then divide by .6 (and round up since we're only working with integer values here).

Unless I missed something, it's pretty simple with a few adjustments.
Math Problem II: 7/1/2016 00:11:57

Dutch Desire
Level 59
Report
@kynte, I dont understand... If I'm attacked with 1234 armies, how manny armies must i have to take the territory with order delay?
Math Problem II: 7/1/2016 00:21:34

Hostile
Level 58
Report

OFF : nb of attackers

DEF : nb of defenders

X : Remaining attackers

Y : Remaining defenders

Y * 0.6 = X ; Y * 6/10 = Y / (10/6) = Y / (5/3) ; Y = X * 5/3

OFF - DEF * 0.7 = X

DEF - OFF * 0.6 = Y

5/3 * (OFF - DEF * 0.7) = DEF - OFF * 0.6

5/3 * 0FF - DEF * 35 / 30 = 5/3 * OFF - DEF * 6/5

Edit :

5/3 * (OFF - DEF * 7/10) = DEF - OFF * 0.6

5/3 * 0FF - DEF * 35 / 30 = 5/3 * OFF - DEF * 6/5

5/3 * OFF - DEF * 7/6 = DEF - OFF * 3/5

DEF + DEF * 7/6 = 5/3 * OFF + 3/5 * OFF

DEF * 13/6 = OFF * (25/15 + 9/15) ; DEF * 13/6 = OFF * (34/15)

DEF = OFF * ((34/15)/(13/6)) ; DEF = OFF * (34/15 * 6/13) ; DEF = OFF * 204/195

DEF = OFF * 204/195

[QED]

Edited 7/1/2016 00:32:32
Math Problem II: 7/1/2016 00:30:39

Hostile
Level 58
Report
I edited.

I calculated 35/30 as equal to 6/5 instead of 7/6.
Math Problem II: 7/1/2016 00:36:07

Carlos
Level 59
Report
for 1234 i calculated 1291 to take the territory in a counter attack. But i may be wrong (it is close to what hostile said, but not exactly -> 1%). Would need to do some equations to be sure - what im not.

Edit.: the new equation (def = off * 204/195 ) that hostile did is correct now

Edited 7/1/2016 00:38:13
Math Problem II: 7/1/2016 00:38:18

Hostile
Level 58
Report
Example :

1000 attackers need 1046.15 defenders with counter attack.

Defenders : 1046.15 - 0.6 * 1000 = 446

Attackers 1000 - 0.7 * 1046.15 = 267.70

267.7 / 0.6 = 446.166666666

Formula works. =)

I am a Math Wolf
Math Problem II: 7/1/2016 00:40:19

kynte
Level 51
Report
@OP: Yeah, looks like I missed the counterattack part. Will recalculate and see if I can get better accuracy than Hostile.

1% might be due to rounding, since remaining defenders aren't actually off * .6 but really off * .6 rounded.

Edited 7/1/2016 00:41:07
Math Problem II: 7/1/2016 00:41:50

Dutch Desire
Level 59
Report
"DEF = OFF * 204/195" --> This is not working.

with OFF=10, the DEF= 10 * 204/195 = 10,46= 10?

But with 10 attacking armies I need 12 to counter...
(10*0,6=6 dmg...12*0,7=8 dmg
10-8= 2+1 remaining...12-6= 6-1 remaining
5*0,6 = 3dmg)
Math Problem II: 7/1/2016 00:43:36

Carlos
Level 59
Report
no kynte, he changed his formula. instead of 204/195 was 180/170.. Now the result of "204/195" was 1290.95, and my result 1291, a good result.
Math Problem II: 7/1/2016 00:44:27

GiantFrog
Level 58
Report
he forgot about one army stands guard option, correct formula is D=(1.36*A+1.6)/1.3
Math Problem II: 7/1/2016 00:49:40

Carlos
Level 59
Report
yes, i forgot that too, GiantFrog formula works better.
Math Problem II: 7/1/2016 01:06:53

Dutch Desire
Level 59
Report
D=(1.36*A+1.6)/1.3

A=7
D=(1.36*7+1.6)/1.3 = 9, while 8 needed.

A=10000
D=(1.36*10000+1.6)/1.3 = 10463, while 10462 needed.

Is a correct formula not possible because of rounding?
Math Problem II: 7/1/2016 01:13:06

GiantFrog
Level 58
Report
my forumla obviously still wasnt including rounding, but i really wouldnt go for that.
The resulting formula wouldnt be handy at all. You d still be way faster calculating D this way and checking D-1 if D worked or go with D+1 in case it didnt.
Math Problem II: 7/1/2016 01:15:37

Hostile
Level 58
Report
(1.36 / 1.3) * 150/150 = 204 / 195

(1.6 / 1.3) * 150/150 = 240 / 195

(204 / 195) * A + 240 / 195 = D

OFF - DEF * 0.7+ 1 = X

5/3 * 6/13 = 30 / 39 = 240 / 312 = 0.77
Math Problem II: 7/1/2016 01:18:14

Hostile
Level 58
Report
0.77 * 1.3 = ~ 1.

:P
Math Problem II: 7/1/2016 01:19:51

Hostile
Level 58
Report
1290.9 for 1234 is really close.

If there is one extra army guarding the territory, you only need to add an extra attacker.

It is the same as adding [0.6]. [0.6] rounded up is 1.

Only defenders may have a decimal part.

You use the floor function to get real number of defenders needed.

Also, add one extra army if [1 army stand guard] setting enabled.

The degree of error due to rounding for two "battles" is not big.

I am the ultimate MATH WOLF.

Edited 7/1/2016 01:20:41
Math Problem II: 7/1/2016 01:34:33

Dutch Desire
Level 59
Report
When A= 1234 then D=1292, not 1291.

My own Formula: (A+1)*1,046=D
seems the most accurate...
Math Problem II: 7/1/2016 01:36:19

Hostile
Level 58
Report
% -> Modulo

If A % 6 >= 3 ,

Remove (-1) from D if true.

If D % 7 >= 4 ,

Remove (-1) from A if true.

If D % 6 >= 3 ,

Remove (-1) from A if true.

Apply the formula.

- The rounding parts were all solved when using modulo.
Math Problem II: 7/1/2016 01:45:38

Hostile
Level 58
Report
1234 % 6 = 4

1290.95 + 1 + 1 = 1292.95

1290 % 7 = 2

1290 % 6 = 0

Needed 1292. :))))
Math Problem II: 7/1/2016 02:27:47

Dutch Desire
Level 59
Report
Yeah a correction connected to the Modulo is logic.

Thanks for solving the math Problem Hostile.
Math Problem II: 7/1/2016 11:14:13

DanWL
Level 62
Report
I've learnt that defending with 5 then someone attacking you with 3, the you counteracting with the remaining armies always works.

3v5 = no armies for the attacker and 3 armies for the defender. Then 2 (see note) v3 = 1 army for the attacker and capturing the territory.

Note: 2 armies because 1 army must stand guard.

Edit: also assuming 0% SR and default kill rates.

Edited 7/1/2016 11:26:24
Math Problem II: 7/1/2016 12:54:58

[HL] Fluk Tuation
Level 58
Report

Edited 7/1/2016 17:26:00
 Posts 1 - 25 of 25