Let

be the number of attackers survived just before the

-th battle (if exist), so it is including those singleton attacker stayed in the territory. And

is the initial number of the attackers. Note that the actual number of attackers entering the the

-th battle is

.

Let

be the number of defenders entering the

-th battle.

Let

be the probability mass function of the number of attackers left after a battle given that the number of attackers and defenders entering the battle are

Therefore the probability of winning is

Sorry if I count it wrong