POTW #17 16 Conditional Probability

������������������������
�����������
�����������������������������������������������������������������
����������������
��������������
���������
�������
Welcome to March Madness! This month, all of the problems will be related to basketball. This week,
USMA is hosting the West Point Invitational Tournament. Five basketball programs from across the
nation have worked hard to earn the right to enter this competition. Each team plays every team once.
To move on to the next round of the tournament, the Math 1 Team needs at least 3 wins. Of course,
victory also depends on the presence of the star player of Math 1, MAJ Collins.
Math 1 plays the Virginia Cavaliers for Game 1, the Harlem Globe Trotters for Game 2, the West Point
Black Knights for Game 3 , and the Duke Blue Devils for Game 4. Game 1 occurs during MAJ Collins'
favorite TV show, dancing with the stars, so there is only a 30% chance he will play in Game 1. MAJ
Collins grew up admiring the Harlem Globe Trotters so there is a 70% chance he will play in Game 2
just to see his heroes. Game 3 occurs on a Saturday morning at 0600, and MAJ Collins likes to sleep in,
so there is a 50% chance he will play in Game 3. Game 4 is against Duke, and MAJ Collins picked
Duke to win the NCAA tournament, so there is an 80% chance he will play just to yell at them for busting his bracket.
Below is a conditional probability table summarizing Math1's chances of winning each game of the
tournament. Let W be the event that Math 1 wins the game, let C be the event that MAJ Collins plays in
game, and let C' be the event that MAJ Collins does not play in the game. P represents probability.
What is the probability that Math 1 will move on to the next round?
2 ���
ConditionalProbability1716.nb
��������
������
We can solve the problem using Mathematica. Let’s first establish a sets of conditions using the probability that MAJ Collins plays (plays = 1 if he plays and 0 if he does not) and the probability that Math 1 wins
(wins = 1 if Math 1 wins and 0 if it does not).
�������
plays = {1, 1, 0, 0};
wins = {1, 0, 1, 0};
So we have four conditions pn representing the four possible combinations of MAJ Collins playing in the
game and the associated probability of Math 1 winning. We put this into EmpiricalDistribution in
the next cell.
�������
�������
 = EmpiricalDistribution[{p1, p2, p3, p4} → Transpose[{plays, wins}]]
����� ������������ ���������
���� ������� �
DataDistribution

Now we put in the know probabilities that MAJ Collins plays, that Math 1 wins given that MAJ Collins
plays, and that Math 1 wins given that MAJ Collins does not play. This gives us three equations. A
fourth equation is given by the fact that the sum of the four possible state probabilities must be 1.
�������
eqs1 =
JoinProbability[p ⩵ 1, {p, w}  ] ⩵
3
10
, Probability[w ⩵ 1  p ⩵ 1, {p, w}  ] ⩵
Probability[w ⩵ 1  p ⩵ 0, {p, w}  ] ⩵
�������

p1 + p2
p1 + p2 + p3 + p4
⩵
3
10
,
p1
p1 + p2
⩵
9
10
,
p3
p3 + p4
8
10
⩵
, {p1 + p2 + p3 + p4 ⩵ 1}
4
5
, p1 + p2 + p3 + p4 ⩵ 1
We have four equations involving four unknowns so we can solve for the four state probabilities as
follows:
�������
�������
sol1 = Solve[eqs1, {p1, p2, p3, p4}]
p1 →
27
100
, p2 →
3
100
, p3 →
14
25
, p4 →
7
50

Plugging these values in we can solve for the probability that Math 1 wins the first game.
�������
Probability[w ⩵ 1, {p, w}  ] /. First[sol1]
83
�������
100
������
We repeat this process to find the probability that Math 1 wins game 2.
9
10
,
ConditionalProbability1716.nb
�������
eqs2 = Join
7
Probability[p ⩵ 1, {p, w}  ] ⩵
10
, Probability[w ⩵ 1  p ⩵ 1, {p, w}  ] ⩵
Probability[w ⩵ 1  p ⩵ 0, {p, w}  ] ⩵
�������
�������
�������
�������
�������
���
75
85
100
,
, {p1 + p2 + p3 + p4 ⩵ 1}
100
p1 + p2
7
p1
17
p3
3

⩵
,
⩵
,
⩵ , p1 + p2 + p3 + p4 ⩵ 1
p1 + p2 + p3 + p4
10 p1 + p2
20 p3 + p4
4
sol2 = Solve[eqs2, {p1, p2, p3, p4}]
p1 →
119
200
, p2 →
21
200
, p3 →
9
40
3
, p4 →
40

Probability[w ⩵ 1, {p, w}  ] /. First[sol2]
41
50
������
We continue by solving for the probability that Math 1 wins game 3.
��������
eqs3 =
JoinProbability[p ⩵ 1, {p, w}  ] ⩵
5
10
��������
��������
��������
6
7
10
,
, {p1 + p2 + p3 + p4 ⩵ 1}
10
p1 + p2
1
p1
7
p3
3

⩵ ,
⩵
,
⩵ , p1 + p2 + p3 + p4 ⩵ 1
p1 + p2 + p3 + p4
2 p1 + p2
10 p3 + p4
5
Probability[w ⩵ 1  p ⩵ 0, {p, w}  ] ⩵
��������
, Probability[w ⩵ 1  p ⩵ 1, {p, w}  ] ⩵
sol3 = Solve[eqs3, {p1, p2, p3, p4}]
p1 →
7
20
, p2 →
3
20
, p3 →
3
10
, p4 →
1
5

Probability[w ⩵ 1, {p, w}  ] /. First[sol3]
13
��������
20
������
Finally, we solve for the probability that Math 1 wins game 4.
��������
eqs4 =
JoinProbability[p ⩵ 1, {p, w}  ] ⩵
8
10
Probability[w ⩵ 1  p ⩵ 0, {p, w}  ] ⩵
��������
, Probability[w ⩵ 1  p ⩵ 1, {p, w}  ] ⩵
5
, {p1 + p2 + p3 + p4 ⩵ 1}
10
p1 + p2
4
p1
3
p3
1

⩵ ,
⩵ ,
⩵ , p1 + p2 + p3 + p4 ⩵ 1
p1 + p2 + p3 + p4
5 p1 + p2
5 p3 + p4
2
6
10
,
3
4 ���
ConditionalProbability1716.nb
��������
��������
��������
sol4 = Solve[eqs4, {p1, p2, p3, p4}]
p1 →
12
25
, p2 →
8
25
, p3 →
1
10
, p4 →
1
10

Probability[w ⩵ 1, {p, w}  ] /. First[sol4]
29
��������
50
�������������������
Having found in the prior sections the probabilities of Math 1 winning each game we can put these
probabilities into a generating function. Here x is the indicator variable that Math 1 wins the game.
��������
g[x_] =
22 491
��������
5 000 000
17
100
+
+
83
100
35 637 x
625 000
x
+
9
50
+
41
50
622 633 x2
2 500 000
x
+
7
20
+
13
20
270 527 x3
625 000
x
+
21
50
+
29
50
x // Expand
1 282 931 x4
5 000 000
The probabilities of Math 1 winning 0 to 4 games sum to 1 as they must.
��������
��������
g[1]
1
Extracting the coefficients of x3 and x4 we get the probabilities that Math 1 wins 3 or 4 games. The
probability of this happening is:
��������
pwin = g[x]〚4 ;; 5〛 /. x → 1
3 447 147
��������
5 000 000
Expressing this result in decimal form the probability that Math 1 wins three or more games is:
��������
N[pwin, 7]
��������
0.6894294