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