Luck doesnt affect products
In a "ask" website (Note I asked before you guys put your responses) I just now got a response, and I figured it rude to just let it rot, by "Psi_Phi_Org"
First, we can look at the "brute force" approach, just listing out all of the win/lose scenarios and calculating the chance for each. I don't recommend this for the general case, but it can be helpful to see how the formulas we develop later work.
Option Number Game 1 Game 2 Game 3 Game 4 Chances
0 L L L L 0.75×0.75×0.75×0.75 = 0.31640625
1 L L L W 0.75×0.75×0.75×0.25 = 0.10546875
2 L L W L 0.75×0.75×0.25×0.75 = 0.10546875
3 L L W W 0.75×0.75×0.25×0.25 = 0.03515625
4 L W L L 0.75×0.25×0.75×0.75 = 0.10546875
5 L W L W 0.75×0.25×0.75×0.25 = 0.03515625
6 L W W L 0.75×0.25×0.25×0.75 = 0.03515625
7 L W W W 0.75×0.25×0.25×0.25 = 0.01171875
8 W L L L 0.25×0.75×0.75×0.75 = 0.10546875
9 W L L W 0.25×0.75×0.75×0.25 = 0.03515625
10 W L W L 0.25×0.75×0.25×0.75 = 0.03515625
11 W L W W 0.25×0.75×0.25×0.25 = 0.01171875
12 W W L L 0.25×0.25×0.75×0.75 = 0.03515625
13 W W L W 0.25×0.25×0.75×0.25 = 0.01171875
14 W W W L 0.25×0.25×0.25×0.75 = 0.01171875
15 W W W W 0.25×0.25×0.25×0.25 = 0.00390625
Now to correlate these to your specific scenarios:
The chance of winning
once in four games is the sum of the chances of winning options 1, 2, 4, or 8. That's 0.10546875×4 = 0.421875 =
42.1875%.
The chance of winning
twice in four games is the sum of options 3, 5, 6, 9, 10, or 12. That's 0.03515625×6 = 0.2109375 =
21.09375%.
The chance of winning
thrice in four games is the sum of options 7, 11, 13, or 14. That's 0.01171875×4 = 0.046875 =
4.6875%.
The chance of winning
all four games is option 15. That's 0.00390625 =
0.390625%.
And though you didn't ask for it specifically, the odds of winning none of the games is option 0. That's 0.31640625 =
31.640625%.
Now, let's analyze this to see
how this all works out.
For each
individual option that had a certain number of wins, the chances were identical. Therefore, to find the total chance for a certain number of wins in
all posiitons, we had to take the
odds for that number of wins in any position, and multiply by the
number of possible ways that could happen. So we need to find formulas for each half of this.
Let's define a couple variables to keep things kind of generic. We'll start by saying P is the percentage for a win in a single game, and N is the total number of games.
When there are four games:
- The base odds of 0 wins are (1-P)(1-P)(1-P)(1-P)
- The base odds of 1 win are (P)(1-P)(1-P)(1-P)
- The base odds of 2 wins are (P)(P)(1-P)(1-P)
- The base odds of 3 wins are (P)(P)(P)(1-P)
- The base odds of 4 wins are (P)(P)(P)(P)
To generalize to N games:
- The base odds of 0 wins are (P)^(0)×(1-P)^(N)
- The base odds of 1 win are (P)^(1)×(1-P)^(N-1)
- The base odds of 2 wins are (P)^(2)×(1-P)^(N-2)
...
- The base odds of X wins are (P)^(X)×(1-P)^(N-X)
...
- The base odds of N-2 wins are (P)^(N-2)×(1-P)^(2)
- The base odds of N-1 wins are (P)^(N-1)×(1-P)^(1)
- The base odds of N wins are (P)^(N)×(1-P)^(0)
The key line here is for X wins:
(P)^(X)×(1-P)^(N-X).
Now let's figure out how many ways there are to win X number of times...
When there are four games:
- To win 0 times, there is 1 way (lose all four)
- To win 1 time, there are 4 ways (win game #1, or #2, or #3, or #4)
- To win 2 times, there are 6 ways (4 ways to win one game × 3 ways to win a second game, but divided by 2 because winning games #2 and #1 is the same as winning games #1 and #2)
- To win 3 times, there are 4 ways (6 ways to win two games × 2 ways to win a third game, but divided by 3 because winning games 1-2-3 is the sams as 1-3-2 and 3-1-2)
- To win 4 times, there is 1 way (win all four)
You may notice that there is a progression from one to the next: ×4/1, ×3/2, ×2/3, ×1/4. That's because for each additional win, you multiply by how many possibilities there are for the next win, but divide by which the number of possibilities with the same game numbers in a different order.
As it turns out, this progression is part of something called
Pascal's Triangle. That's a triangle where each row is one number longer than the row above it, and each number is the sum of the two numbers above it (pretend that there are extra 0's at both ends of the previous row to calculate the numbers on the ends). Take a look at the first few rows:
1
1 · 1
1 · 2 · 1
1 · 3 · 3 · 1
1 · 4 · 6 · 4 · 1
1 · 5 · 10·10 · 5 · 1
1 · 6 · 15 ·20· 15 · 6 · 1
1 · 7 · 21 · 35·35 · 21 · 7 · 1
1 · 8 · 28 · 56 ·70· 56 · 28 · 8 · 1
For any given row in Pascal's Triangle, the same progression holds. For example, on row 7 (counting the row with a single 1 as "row 0"), the progression is ×7/1, ×6/2, ×5/3, ×4/4, ×3/5, ×2/6, ×1/7.
Another way of calculating this is to use a function called factorial, which is the product of all the numbers from the given number to 1. The expression 4! is read aloud as "four factorial", and it means 4×3×2×1. (By definition, 0! = 1, which is the only part of the factorial that may not be obvious.) With this function, the numbers on row 4 can also be written like this:
4!/(0!×4!), 4!/(1!×3!), 4!/(2!×2!), 4!/(3!×1!), 4!/(4!×0!)
For 4 games:
- For 0 wins, there are 4!/(0!×4!) ways that could happen.
That's (4×3×2×1)/((1)×(4×3×2×1)) = 1.
- For 1 win, there are 4!/(1!×3!) ways. That's (4×3×2×1)/((1)×(3×2×1)) = 4.
- For 2 wins, there are 4!/(2!×2!) ways. That's (4×3×2×1)/((2×1)×(2×1)) = 6.
- For 3 wins, there are 4!/(3!×1!) ways. That's (4×3×2×1)/((3×2×1)×(1)) = 4.
- For 4 wins, there are 4!/(4!×0!) ways. That's (4×3×2×1)/((4×3×2×1)×(1)) = 1.
Then for N games:
- For 0 wins, there are N!/(0!×N!) ways that could happen.
- For 1 win, there are N!/(1!×(N-1)!) ways.
- For 2 wins, there are N!/(2!×(N-2)!) ways.
...
- For X wins, there are N!/(X! × (N-X)!) ways.
...
- For N-1 wins, there are N!/((N-1)!×1!) ways.
- For N wins, there are N!/(N!×0!) ways.
Now to combine everything together...
If the chance of winning a game is P, and there are N games, then the chance of winning exactly X of those games is:
((P)^(X) × (1-P)^(N-X)) × (N!/(X! × (N-X)!))
Or by moving the parentheses:
((P)^(X) × (1-P)^(N-X) × N!)/(X! × (N-X)!)
Let's run one of our initial questions through, just to make sure it's right. If the chance of winning a game is 25% (P), and there are 4 games (N), then the chance of winning 2 times (X) should be:
(
(0.25)^(2) × (
1-0.25)^(
4-2) ×
4!)/(
2! ×
(4-2)!)
= (
0.0625 × (
0.75)^(
2) ×
4×3×2×1)/(
(2×1) ×
2!)
= (
0.0625 × (
0.5625) ×
24)/(
2 × (
2×1))
= (
0.84375)/(
4)
= 0.2109375
That matches what we got by the brute-force method. That confirms that the general-case solution is:
((P)^(X) × (1-P)^(N-X) × N!)/(X! × (N-X)!)
-----------------------------------------------------------
The size of it scares me >_<