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

probability

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}");
     }
 }

Best Answer

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$.