Recruit

**Posts:** 32

**Joined:** 07 Dec 2015, 07:29

**Location:** Perth, Australia. Or Taiwan.

**KaM Skill Level:** Expert

### Maths (probability) for unit types fighting each other

I will be releasing a proposal prototype for units and balancing for Knight's Province soon.

First I want to establish a good example of 2 units of different levels fighting each other.

In summary, the process has been:

A. See chance for each to hit each other, using Kistrel’s KAM_proportions.exe

B. Calculate swings required for each unit to have about 50% chance to kill each other.

C. See how quick the winner usually wins.

D. See how many weaker units in a row are needed to win.

E. Calculate how many the stronger could kill if full health each time.

The classic Axe Fighter vs Sword Fighter.

That is: 2 attack, 1 armor vs 3 attack, 2 armor.

Part 1.

By the calculator, its 11.67% chance for Axe to hit Sword.

Its 27.5% chance for Sword to hit axe.

If Axe fighter swings 5 times, his chance to hit 1 time or more should be:

[Chance to not hit to the fifth power, and then minus this from one]:

Ie: 1 – ( (1 - 0.1167) ^5)

= 1 – ( 0.8833 ^5 )

= 1 – ( 0.5377 )

= 0.462 = 46% chance to hit at least once.

If Sword fighter swings 5 times, his chance to hit 1 time or more should be:

1 – ( (1 - 0.27.5) ^5)

= 1 – ( 0.725 ^5 )

= 1 – ( 0.2 )

= 0.8 = 80% chance to hit at least once.

Conclusion here – about twice as much damage?

There is a chance they will hit 2 times or more.

This requires more math than is worth showing – using a binomial calculator (http://stattrek.com/online-calculator/binomial.aspx) I used for axe fighter:

0.1167 chance to hit (success).

5 swings (trials)

2 hit (success required)

Chance for at least 2 hits from 5 swings: 10.7%

For Sword fighter, it is: 42%

More than twice as much damage?

Now, chance to kill – 3 hits from 5, is:

Axe Fighter: 1.3%

Sword Fighter: 13%

Ten times as much damage?

Both a low chance, but big difference! (in chance of sudden death) We begin to see why strong units can hold off weaker units 1v1 for a very long time!

More realistically, let’s use 10 swings.

Axe Fighter: 10% chance to kill

Sword Fighter: 55% chance to kill

Could you argue that a Sword Fighter could kill 3-6 Axe fighters in a row, in 1v1?

Lets see how many swings from Axe Fighters it typically takes to kill a Sword Fighter:

20 swings from Axe Fighter: 42% chance to kill

25 swings from Axe Fighter: 57% chance to kill

30 swings from Axe Fighter: 70% chance to kill

Therefore with about the same chance to kill, 55%,

a sword fighter needs to swing 10 times.

an axe fighter needs to swing 25 times.

From this you could estimate 2-3 axe fighters would be needed to win (to get up to 25 swings).

This is conclusion #1.

Part 2:

However if the sword fighter is given time to heal, he could hold off about 5-6 axe fighters before he is more likely to die. Right?

Or is it 10x?

Let’s look at it this way – calculate the chance that a single axe fighter can win in 1v1 directly.

Aka, this = 1.00 minus chance of Sword Fighter to win.

Chance of Sword Fighter to win calculation:

0.275 chance to hit (success)

25 swings (trials), because this is the amount to give Axe fighter 55% chance to kill.

3 hits (success required)

Calculator gives 98.27% chance of Sword Fighter winning in 25 swings or less.

A single Axe fighter thus has

1.00 – 98.27% chance

= less than 2% chance to win in 25 swings or less.

Overall, this should be <2% chance of surviving to have a 57% chance of winning.

so there is more likely only a ~1% chance of axe fighter winning 1v1.

Putting that 1% chance of winning into the calculator, then how many axe fighters fighting a full health sword fighter would be needed for over 50% chance of winning?

Calculator’s closest estimate is 69 Axe Fighters needed to clear 1 Sword Fighter.

Therefore on average, a full heath Sword Fighter can hold off an average of 69 Axe Fighters!!

Or you will need probably 70+ Axe Fighters to kill off 1 Sword Fighter if he is allowed to regen health!

Wow, this is a special game!