# How do you estimate total % chance based on smaller % chances?

I'm working on a small game project and want to figure out how I can calculate the total % chance that a player will win a war based on the percentage chance of them winning each individual battle in the war.

For instance, if there are 3 battles and their chance of winning each battle is: 10%, 20%, and 50% what is the math formula that would allow me to estimate what their total chances of winning the whole war will be?

Thanks!

~

-
What is the precise criterion for winning the war? Are battles one on some graded scale or are they merely 'won' or 'lost'? –  A Blumenthal Feb 1 '13 at 0:33
fyi > McNamara tried all that statistical control stuff during Vietnam. –  alancalvitti Feb 1 '13 at 0:38
The criteria for winning the war is simply winning x number of battles. The criteria for winning the battles is based on low-level stats such as attack power and defence, and % chance of critical strikes, etc. –  Azuma Feb 1 '13 at 0:42
For your example, if you need to win at least two out of three, the probability is $\big(0.1\times0.2\times0.5\big)$ $+$ $\big((1-0.1)\times0.2\times0.5\big)$ $+$ $\big(0.1\times(1-0.2)\times0.5\big)$ $+$ $\big(0.1\times0.2\times(1-0.5)\big)$ $=$ $0.15$. Perhaps you can see the pattern. –  Rahul Feb 1 '13 at 1:03
Would I do the same thing in the case where I need to win all the battles and each battle has a certain probability of me winning / losing? –  Azuma Feb 1 '13 at 1:27

You can use the Poisson Binomial distribution. Also look at these interesting notes on how you can derive at an approximation for the same (under certain conditions you can approximate the characteristics of the Poisson Binomial distribution as Poisson).

-

I think what you want is a binomial distribution. This states that if you have $n$ trials, each of which can either end in either success or failure (in your case, winning a battle), and the probability of a single success is $p$, then the probability of having $k$ successes out of $n$ is

$$P(K=k) = \binom{n}{k} p^k (1-p)^{n-k}$$

where $K$ is a random variable representing the number of successes.

So, to compute the chances of winning a war, you'd need to know how many battles out of a given set of battles you need to win in order to win the war. Let's say that you need to win at least $k_0$ battles to win. In this case, the probability of winning the war would be

$$P(K \ge k_0) = \sum_{k=k_0}^n \binom{n}{k} p^k (1-p)^{n-k}$$

As a concrete example, let's say that there are 5 battles in the war, and you need to win at least 3 to win the war. Let's also say that the probability of winning a battle is 30% (i.e., $p=0.3$). Then the probability of winning the war is then

$$P(K \ge 3) = \binom{5}{3} (0.3)^3 (0.7)^2 + \binom{5}{4} (0.3)^4 (0.7)^1 + \binom{5}{5} (0.3)^5 (0.7)^0 \approx 0.163$$

-
each trial has a different probability of success or failure, so simple binomial won't work as per OP's question. –  jay-sun Feb 1 '13 at 1:14
Ok, thanks! I'll give this a try. –  Azuma Feb 1 '13 at 1:15
@jay-sun: I agree. That said, if the OP can average over the trials and say that each one has a single prob of success, then this simple formulation could be useful. –  Ron Gordon Feb 1 '13 at 1:17
Edit: Just to clarify, this will allow me to figure out the total probability of winning x number of battles (the war) based on the probability that I have of winning each battle? –  Azuma Feb 1 '13 at 1:21
That is correct, and as @jay-sun points out, it assumes that the prob of winning each battle is the same. One thing you might do if they are different is average the probs. together and use that average as $p$. –  Ron Gordon Feb 1 '13 at 1:26