07: Variance, Bernoulli, Binomial - Stanford University
Transcript of 07: Variance, Bernoulli, Binomial - Stanford University
07: Variance, Bernoulli, BinomialJerry CainApril 12, 2021
1
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
Quick slide reference
2
3 Variance 07a_variance_i
10 Properties of variance 07b_variance_ii
17 Bernoulli RV 07c_bernoulli
22 Binomial RV 07d_binomial
34 Exercises LIVE
Variance
3
07a_variance_i
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
Stanford, CAπΈ high = 68Β°FπΈ low = 52Β°F
Washington, DCπΈ high = 67Β°FπΈ low = 51Β°F
4
Average annual weather
Is πΈ π enough?
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
Stanford, CAπΈ high = 68Β°FπΈ low = 52Β°F
Washington, DCπΈ high = 67Β°FπΈ low = 51Β°F
5
Average annual weather
0
0.1
0.2
0.3
0.4
0
0.1
0.2
0.3
0.4
ππ=π₯
ππ=π₯
Stanford high temps Washington high temps
35 50 65 80 90 35 50 65 80 90
68Β°F 67Β°F
Normalized histograms are approximations of PMFs.
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
Variance = βspreadβConsider the following three distributions (PMFs):
β’ Expectation: πΈ π = 3 for all distributionsβ’ But the βspreadβ in the distributions is different!β’ Variance, Var π : a formal quantification of βspreadβ
6
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
Variance
The variance of a random variable π with mean πΈ π = π is
Var π = πΈ π β π (
β’ Also written as: πΈ π β πΈ π !
β’ Note: Var(X) β₯ 0β’ Other names: 2nd central moment, or square of the standard deviation
Var π
def standard deviation SD π = Var π7
Units of π!
Units of π
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
Variance of Stanford weather
8
Varianceof π
Var π = πΈ π β πΈ π !
Stanford, CAπΈ high = 68Β°FπΈ low = 52Β°F
0
0.1
0.2
0.3
0.4
ππ=π₯
Stanford high temps
35 50 65 80 90
π π β π !
57Β°F 121 (Β°F)2
πΈ π = π = 68Β°F
71Β°F 9 (Β°F)2
75Β°F 49 (Β°F)2
69Β°F 1 (Β°F)2
β¦ β¦
Variance πΈ π β π ! = 39 (Β°F)2
Standard deviation = 6.2Β°F
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
Stanford, CAπΈ high = 68Β°F
Washington, DCπΈ high = 67Β°F
9
Comparing variance
0
0.1
0.2
0.3
0.4
0
0.1
0.2
0.3
0.4
ππ=π₯
ππ=π₯
Stanford high temps Washington high temps
35 50 65 80 90 35 50 65 80 90
Var π = 39 Β°F ! Var π = 248 Β°F !
Varianceof π
Var π = πΈ π β πΈ π !
68Β°F 67Β°F
Properties of Variance
10
07b_variance_ii
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
Properties of varianceDefinition Var π = πΈ π β πΈ π !
def standard deviation SD π = Var π
Property 1 Var π = πΈ π! β πΈ π !
Property 2 Var ππ + π = π!Var π
11
Units of π!
Units of π
β’ Property 1 is often easier to compute than the definitionβ’ Unlike expectation, variance is not linear
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
Properties of varianceDefinition Var π = πΈ π β πΈ π !
def standard deviation SD π = Var π
Property 1 Var π = πΈ π! β πΈ π !
Property 2 Var ππ + π = π!Var π
12
Units of π!
Units of π
β’ Property 1 is often easier to compute than the definitionβ’ Unlike expectation, variance is not linear
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
Computing variance, a proof
13
Var π = πΈ π β πΈ π !
= πΈ π! β πΈ π !
= πΈ π! β π!= πΈ π! β 2π! + π!= πΈ π! β 2ππΈ π + π!
= πΈ π β π ! Let πΈ π = π
Everyone, please
welcome the second
moment!
Varianceof π
Var π = πΈ π β πΈ π !
= πΈ π! β πΈ π !
=,"
π₯ β π !π π₯
=,"
π₯! β 2ππ₯ + π! π π₯
=,"
π₯!π π₯ β 2π,"
π₯π π₯ + π!,"
π π₯
β 1
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
Let Y = outcome of a single die roll. Recall πΈ π = 7/2 .Calculate the variance of Y.
14
Variance of a 6-sided dieVarianceof π
Var π = πΈ π β πΈ π !
= πΈ π! β πΈ π !
1. Approach #1: Definition
Var π =161 β
72
!+162 β
72
!
+163 β
72
!+164 β
72
!
+165 β
72
!+166 β
72
!
2. Approach #2: A property
πΈ π! =161! + 2! + 3! + 4! + 5! + 6!
= 91/6
Var π = 91/6 β 7/2 !
= 35/12 = 35/12
2nd moment
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
Properties of varianceDefinition Var π = πΈ π β πΈ π !
def standard deviation SD π = Var π
Property 1 Var π = πΈ π! β πΈ π !
Property 2 Var ππ + π = π!Var π
15
Units of π!
Units of π
β’ Property 1 is often easier to compute than the definitionβ’ Unlike expectation, variance is not linear
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
Property 2: A proofProperty 2 Var ππ + π = π!Var π
16
Var ππ + π= πΈ ππ + π ! β πΈ ππ + π ! Property 1
= πΈ π!π! + 2πππ + π! β ππΈ π + π !
= π!πΈ π! + 2πππΈ π + π! β π! πΈ[π] ! + 2πππΈ[π] + π!
= π!πΈ π! β π! πΈ[π] !
= π! πΈ π! β πΈ[π] !
= π!Var π Property 1
Proof:
Factoring/Linearity of Expectation
Bernoulli RV
17
07c_bernoulli
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
Consider an experiment with two outcomes: βsuccessβ and βfailure.βdef A Bernoulli random variable π maps βsuccessβ to 1 and βfailureβ to 0.
Other names: indicator random variable, boolean random variable
Examples:β’ Coin flipβ’ Random binary digitβ’ Whether a disk drive crashed
Bernoulli Random Variable
18
π π = 1 = π 1 = ππ π = 0 = π 0 = 1 β ππ~Ber(π)
Support: {0,1} VarianceExpectation
PMF
πΈ π = πVar π = π(1 β π)
Remember this nice property of expectation. It will come back!
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
Jacob Bernoulli
19
Jacob Bernoulli (1654-1705), also known as βJamesβ, was a Swiss mathematician
One of many mathematicians in Bernoulli familyThe Bernoulli Random Variable is named for him
My academic great14 grandfather
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
Defining Bernoulli RVs
20
Serve an ad.β’ User clicks w.p. 0.2β’ Ignores otherwise
Let π: 1 if clicked
π~Ber(___)π π = 1 = ___π π = 0 = ___
Roll two dice.β’ Success: roll two 6βsβ’ Failure: anything else
Let π : 1 if success
π~Ber(___)
πΈ π = ___
π~Ber(π) π" 1 = ππ" 0 = 1 β ππΈ π = π
Run a programβ’ Crashes w.p. πβ’ Works w.p. 1 β π
Let π: 1 if crash
π~Ber(π)π π = 1 = ππ π = 0 = 1 β π π€
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
Defining Bernoulli RVs
21
Serve an ad.β’ User clicks w.p. 0.2β’ Ignores otherwise
Let π: 1 if clicked
π~Ber(___)π π = 1 = ___π π = 0 = ___
Roll two dice.β’ Success: roll two 6βsβ’ Failure: anything else
Let π : 1 if success
π~Ber(___)
πΈ π = ___
π~Ber(π) π" 1 = ππ" 0 = 1 β ππΈ π = π
Run a programβ’ Crashes w.p. πβ’ Works w.p. 1 β π
Let π: 1 if crash
π~Ber(π)π π = 1 = ππ π = 0 = 1 β π
Binomial RV
22
07d_binomial
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
Consider an experiment: π independent trials of Ber(π) random variables.def A Binomial random variable π is the number of successes in π trials.
Examples:β’ # heads in n coin flipsβ’ # of 1βs in randomly generated length n bit stringβ’ # of disk drives crashed in 1000 computer cluster
(assuming disks crash independently)
Binomial Random Variable
23
π = 0, 1, β¦ , π:
π π = π = π π = ππ π! 1 β π "#!π~Bin(π, π)
Support: {0,1, β¦ , π}
PMF
πΈ π = ππVar π = ππ(1 β π)Variance
Expectation
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021 24
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
Reiterating notation
The parameters of a Binomial random variable:β’ π: number of independent trialsβ’ π: probability of success on each trial
25
1. The random variable
2. is distributed as a
3. Binomial 4. with parameters
π ~ Bin(π, π)
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
Reiterating notation
If π is a binomial with parameters π and π, the PMF of π is
26
π ~ Bin(π, π)
π π = π = ππ π( 1 β π )*(
Probability Mass Function for a BinomialProbability that πtakes on the value π
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
Three coin flipsThree fair (βheadsβ with π = 0.5) coins are flipped.β’ π is number of headsβ’ π~Bin 3, 0.5
Compute the following event probabilities:
27
π~Bin(π, π) π π = ππ π# 1 β π $%#
π π = 0
π π = 1
π π = 2
π π = 3
π π = 7P(event)
π€
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
Three coin flipsThree fair (βheadsβ with π = 0.5) coins are flipped.β’ π is number of headsβ’ π~Bin 3, 0.5
Compute the following event probabilities:
28
π~Bin(π, π) π π = ππ π# 1 β π $%#
π π = 0 = π 0 = 30 π$ 1 β π % = &
'
π π = 1
π π = 2
π π = 3
π π = 7
= π 1 = 31 π& 1 β π ! = %
'
= π 2 = 32 π! 1 β π & = %
'
= π 3 = 33 π% 1 β π $ = &
'
= π 7 = 0P(event) PMF
Extra math note:By Binomial Theorem,we can proveβ()$* π π = π = 1
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
Consider an experiment: π independent trials of Ber(π) random variables.def A Binomial random variable π is the number of successes in π trials.
Examples:β’ # heads in n coin flipsβ’ # of 1βs in randomly generated length n bit stringβ’ # of disk drives crashed in 1000 computer cluster
(assuming disks crash independently)
Binomial Random Variable
29
π~Bin(π, π)Range: {0,1, β¦ , π} Variance
Expectation
PMF
πΈ π = ππVar π = ππ(1 β π)
π = 0, 1, β¦ , π:
π π = π = π π = ππ π! 1 β π "#!
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
Ber π = Bin(1, π)
Binomial RV is sum of Bernoulli RVs
Bernoulliβ’ π~Ber(π)
Binomialβ’ π~Bin π, πβ’ The sum of π independent
Bernoulli RVs
30
π =,+)&
*
π+ , π+ ~Ber(π)
+
+
+
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
Consider an experiment: π independent trials of Ber(π) random variables.def A Binomial random variable π is the number of successes in π trials.
Examples:β’ # heads in n coin flipsβ’ # of 1βs in randomly generated length n bit stringβ’ # of disk drives crashed in 1000 computer cluster
(assuming disks crash independently)
Binomial Random Variable
31
π~Bin(π, π)Range: {0,1, β¦ , π}
πΈ π = ππVar π = ππ(1 β π)Variance
Expectation
PMF π = 0, 1, β¦ , π:
π π = π = π π = ππ π! 1 β π "#!
Proof:
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
Consider an experiment: π independent trials of Ber(π) random variables.def A Binomial random variable π is the number of successes in π trials.
Examples:β’ # heads in n coin flipsβ’ # of 1βs in randomly generated length n bit stringβ’ # of disk drives crashed in 1000 computer cluster
(assuming disks crash independently)
Binomial Random Variable
32
π~Bin(π, π)Range: {0,1, β¦ , π}
PMF
πΈ π = ππVar π = ππ(1 β π)
Weβll prove this later in the course
VarianceExpectation
π = 0, 1, β¦ , π:
π π = π = π π = ππ π! 1 β π "#!
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
No, give me the variance proof right now
33
proofwiki.org
(live)07: Variance, Bernoulli, and BinomialJerry CainApril 12, 2021
34
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
Our first common RVs
35
π ~ Ber(π)
π ~ Bin(π, π)
1. The random variable
2. is distributed as/varies as a
3. Bernoulli 4. with parameter
Example: Heads in one coin flip,P(heads) = 0.8 = p
Example: # heads in 40 coin flips,P(heads) = 0.8 = p
otherwise Identify PMF, oridentify as a function of an existing random variable
Review
Breakout Rooms
Check out the questions on the next slide (Slide 37). Post any clarifications here!https://edstem.org/us/courses/5090/discussion/357155
Breakout rooms: 4 min. Donβt worry if itβs not enough time. Just do your best and weβll cover these when we return.
36
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
Statistics: Expectation and variance1. a. Let π = the outcome of a fair 4-sided
die roll. What is πΈ π ?b. Let π = the sum of three rolls of a fair
4-sided die. What is πΈ π ?
2. Let π = # of tails on 10 flips of abiased coin (w.p. 0.4 of heads). What is πΈ π ?
3. Compare the variances ofπ΅2~Ber 0.1 and π΅!~Ber(0.5).
37
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
Statistics: Expectation and variance1. a. Let π = the outcome of a fair 4-sided
die roll. What is πΈ π ?b. Let π = the sum of three rolls of a fair
4-sided die. What is πΈ π ?
2. Let π = # of tails on 10 flips of abiased coin (w.p. 0.4 of heads). What is πΈ π ?
3. Compare the variances ofπ΅2~Ber 0.1 and π΅!~Ber(0.5).
38
If you can identify common RVs, just look up statistics instead of re-deriving from definitions.
Think
Slide 40 has a matching question to go over by yourself. Weβll go over it together afterwards.
Post any clarifications here!https://edstem.org/us/courses/5090/discussion/357155
Think by yourself: 1 min Donβt worry if you canβt figure everything out in just one minute. This material is difficult.
39
(by yourself)
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
Visualizing Binomial PMFs
40
0
0.1
0.2
0.3
0 1 2 3 4 5 6 7 8 9 100
0.1
0.2
0.3
0 1 2 3 4 5 6 7 8 9 10
π~Bin(π, π) π π = ππ π# 1 β π $%#
πΈ π = ππ
C. D.Match the distribution of π to the graph:1. Bin 10,0.52. Bin 10,0.33. Bin 10,0.74. Bin 5,0.5
0
0.1
0.2
0.3
0 1 2 3 4 5 6 7 8 9 100
0.1
0.2
0.3
0 1 2 3 4 5 6 7 8 9 10
A. B.
π
ππ=π
π
ππ=π
π
ππ=π
π
ππ=π
(by yourself)
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
Visualizing Binomial PMFs
41
Match the distribution of π to the graph:1. Bin 10,0.52. Bin 10,0.33. Bin 10,0.74. Bin 5,0.5
0
0.1
0.2
0.3
0 1 2 3 4 5 6 7 8 9 100
0.1
0.2
0.3
0 1 2 3 4 5 6 7 8 9 10
C. D.
0
0.1
0.2
0.3
0 1 2 3 4 5 6 7 8 9 100
0.1
0.2
0.3
0 1 2 3 4 5 6 7 8 9 10
A. B.
π
ππ=π
π
ππ=π
π
ππ=π
π
ππ=π
π~Bin(π, π) π π = ππ π# 1 β π $%#
πΈ π = ππ
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
Binomial RV is sum of Bernoulli RVs
Bernoulliβ’ π~Ber(π)
Binomialβ’ π~Bin π, πβ’ The sum of π independent
Bernoulli RVs
42
π =,+)&
*
π+ , π+ ~Ber(π)
+
+
+
Review
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
Galton Board
43
0 1 2 3 4 5
http://web.stanford.edu/class/cs109/demos/galton.html
ThinkSlide 45 has a question to go over by yourself.
Post any clarifications here!https://edstem.org/us/courses/5090/discussion/357155
Think by yourself and just do your best: 1 min
44
(by yourself)
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
Galton Board
45
When a marble hits a pin, it has an equal chance of going left or right.Let π΅ = the bucket index a ball drops into.What is the distribution of π΅?
0 1 2 3 4 5
π = 5
π~Bin(π, π) π π = ππ π# 1 β π $%#
(by yourself)
(Interpret: If π΅ is a common random variable, report it,
otherwise report PMF)
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
Galton Board
46
When a marble hits a pin, it has an equal chance of going left or right.Let π΅ = the bucket index a ball drops into.What is the distribution of π΅?
0 1 2 3 4 5
π = 5
π~Bin(π, π) π π = ππ π# 1 β π $%#
β’ Each pin is an independent trialβ’ One decision made for level π = 1, 2, . . , 5β’ Consider a Bernoulli RV with success π + if
ball went right on level π
β’ Bucket index π΅ = # times ball went right
π΅~Bin(π = 5, π = 0.5)
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
Galton Board
47
When a marble hits a pin, it has an equal chance of going left or right.Let π΅ = the bucket index a ball drops into.π΅ is distributed as a Binomial RV,
π΅~Bin(π = 5, π = 0.5)
0 1 2 3 4 5
π = 5 Calculate the probability of a ball landing in bucket π.
π π΅ = 0 = 50 0.51 β 0.03
π π΅ = 1 = 51 0.51 β 0.16
π π΅ = 2 = 52 0.51 β 0.31
π~Bin(π, π) π π = ππ π# 1 β π $%#
PMF of Binomial RV!
Interlude for announcements
48
Python review session next
Python Review Session 2
When: Today 2:00-3:30pm PTRecorded? obvi, right hereNotes: to be posted online
Think, thenBreakout Rooms
Check out the questions on the next slide (Slide 50). Post any clarifications here!https://edstem.org/us/courses/5090/discussion/357155
By yourself: 1 min
Breakout rooms: 5 min.
49
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
Genetics and NBA Finals1. Each parent has 2 genes per trait (e.g., eye color).β’ Child inherits 1 gene from each parent with equal likelihood.β’ Brown eyes are βdominantβ, blue eyes are βrecessiveβ:β’ Child has brown eyes if either or both genes for brown eyes are inherited.β’ Child has blue eyes otherwise (i.e., child inherits two genes for blue eyes)
β’ Assume parents each have 1 gene for blue eyes and 1 gene for brown eyes.Two parents have 4 children. What is P(exactly 3 children have brown eyes)?
2. The LA Lakers are going to play the Miami Heat in a7-game series during the 2021 NBA finals.
β’ The Lakers have a probability of 58% of winning each game, independently.β’ A team wins the series if they win at least 4 games (we play all 7 games).
What is P(Lakers winning)?
50
π~Bin(π, π) π π = ππ π# 1 β π $%#
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
Genetic inheritance1. Each parent has 2 genes per trait (e.g., eye color).β’ Child inherits 1 gene from each parent with equal likelihood.β’ Brown eyes are βdominantβ, blue eyes are βrecessiveβ:β’ Child has brown eyes if either or both genes for brown eyes are inherited.β’ Child has blue eyes otherwise (i.e., child inherits two genes for blue eyes)
β’ Assume parents each have 1 gene for blue eyes and 1 gene for brown eyes.Two parents have 4 children. What is P(exactly 3 children have brown eyes)?
51
Big Q: Fixed parameter or random variable?Parameters What is common among all outcomes
of our experiment?
Random variable What differentiates our event from the rest of the sample space?
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
1. Each parent has 2 genes per trait (e.g., eye color).β’ Child inherits 1 gene from each parent with equal likelihood.β’ Brown eyes are βdominantβ, blue eyes are βrecessiveβ:β’ Child has brown eyes if either or both genes for brown eyes are inherited.β’ Child has blue eyes otherwise (i.e., child inherits two genes for blue eyes)
β’ Assume parents each have 1 gene for blue eyes and 1 gene for brown eyes.Two parents have 4 children. What is P(exactly 3 children have brown eyes)?
52
Genetic inheritance
1. Define events/ RVs & state goal
3. Solve
π: # brown-eyed children,π~Bin(4, π)
π: π brownβeyed child
Want: π π = 3
2. Identify knownprobabilities
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
NBA FinalsThe LA Lakers are going to play the Miami Heatin a 7-game series during the 2021 NBA finals.β’ The Lakers have a probability of 58% of
winning each game, independently.β’ A team wins the series if they win at least 4 games
(we play all 7 games).
What is P(Lakers winning)?
53
1. Define events/ RVs & state goal
π: # games Lakers winπ~Bin(7, 0.58)
Want:
Big Q: Fixed parameter or random variable?Parameters
Random variable
Event based on RV
# of total gamesprob. Lakers winning a game
# of games Lakers win
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
NBA FinalsThe LA Lakers are going to play the Miami Heatin a 7-game series during the 2021 NBA finals.β’ The Lakers have a probability of 58% of
winning each game, independently.β’ A team wins the series if they win at least 4 games
(we play all 7 games).
What is P(Lakers winning)?
54
Cool Algebra/Probability Fact: this is identical to the probability of winning if we define winning = first to win 4 games
1. Define events/ RVs & state goal
2. Solve
π: # games Lakers winπ~Bin(7, 0.58)
Want: π π β₯ 4
π π β₯ 4 = ,()2
3
π π = π = ,()2
37π 0.58( 0.42 34(
Lisa Yan, Chris Piech, Mehran Sahami, and Jerry Cain, CS109, Spring 2021
See you on Wednesday
55