# Probability of winning 3 out of 5 games (with different winning chance on each game)

I have a trick problem I can't solve.

A simple chess tournament between 2 teams (of 5 players each).

Each player will face only one person from the other team.

The probabilities of winning each game for Team A against Team B:

• First Game = 50%
• Second Game = 60%
• Third Game = 5%
• Fourth Game = 0%
• Fifth Game = 40%

What is the probability of Team A winning 3 games or more?

Keeping in mind that if the winning chance in 3 games were zero, then it already makes it impossible to win 3 of 5 games, making the probability of winning the tournament 0%.

Based on the answers, I decided to write a C# implementation

class Program
{
static void Main()
{
var probabilities = new List<float> { 0.5f, 0.6f, 0.05f, 0f, 0.4f };
var requiredWins = 3;
var combinations = Math.Pow(2, probabilities.Count);
var totalWinningChance = 0f;

for (var i = 0; i < combinations; i++)
{
var bitArray = new BitArray(new[] { i });
var trueCount = bitArray.OfType<bool>().Count(p => p);
if (trueCount < requiredWins)
continue;

var winningChance = 1f;
for (var k = 0; k < probabilities.Count; k++)
{
var result = bitArray[k];
var p = result ? probabilities[k] : 1 - probabilities[k];
winningChance *= p;
}
totalWinningChance += winningChance;
}

Console.WriteLine(\$"totalWinningChance {totalWinningChance}");
}
}


You do not have to run one million simulations to estimate the probability of winning exactly three games. What you would have to do, is calculate the probability of each of the possible scenarios. Since you need to win three out of five games, the number of valid combinations equals $${5 \choose 3} = 10$$. The following Python program takes care of this:

from itertools import permutations

def unique_permutations(iterable, r=None):
previous = tuple()
for p in permutations(sorted(iterable), r):
if p > previous:
previous = p
yield p

p_win = [0.5, 0.6, 0.05, 0, 0.4]
p_tot = 0
for t in unique_permutations([1, 1, 1, 0, 0]):
p = 1
for i in range(5):
p *= p_win[i] if p[i] else 1 - p_win[i]
p_tot += p
print(p_tot)


Overall, we find that the probability of winning exactly three games equals $$0.133$$.

I'm not exactly sure what you mean in your question so I will go over the 2 meanings I see.

First, let's see the probability of team A winning exactly 3 games out of 5. Since game 4 is always lost, that is the probability of winning all but one of the other games. This means that you can either lose game 1 2 3 or 5 and win all other. The probability of losing game 1 and winning game 2 3 and 5 is $$(1-0.5)*0.6*0.05*0.04$$ To get the total probability, you just sum all this probabilities so you get: \begin{align} & (1-0.5)&*0.6&*0.05&*0.04 \\ +& 0.5&*(1-0.6)&*0.05&*0.04 \\ +& 0.5&*0.6&*(1-0.05)&*0.04 \\ +& 0.5&*0.6&*0.05&*(1-0.04) \\ \end{align} I'll let you do the calculation.

If you're looking for the probability of team A to win, you also have to add the event where 4 or 5 people wins in team A, 5 is impossible and 4 has probability $$0.5 * 0.6 *0.05* 0.04$$

Here is a neat way to perform the computation. Let \begin{align} f_1(x) &= 0.5 + 0.5x\\ f_2(x) &= 0.4 + 0.6x\\ f_3(x) &= 0.95 + 0.05 x\\ f_4(x) &= 1 \\ f_5(x) &= 0.6 + 0.4 x \end{align} Now expand the product of these five polynomials: $$f_1(x) f_2(x) f_3(x) f_4(x) f_5(x) = 0.114\, +0.367 x+0.38 x^2+0.133 x^3+0.006 x^4$$ The coefficient of $$x^n$$ in the result is the probability that Team A will win exactly $$n$$ games. So the probability that Team A will win 3 or 4 games is $$0.133 +0.006 = \boxed{0.139}$$ The probability of winning five games is zero. We knew that anyway, but it is confirmed by the fact that the coefficient of $$x^5$$ is zero.