Professional Documents
Culture Documents
Deriving The Binomial PMF: David Gerard Most Slides Borrowed From Linda Collins 2017-09-28
Deriving The Binomial PMF: David Gerard Most Slides Borrowed From Linda Collins 2017-09-28
David Gerard
Most slides borrowed from Linda Collins
2017-09-28
1
Learning Objectives
2
A formula
3
Using counting rules to determine probabilities i
4
Permutations
Permutations:
4 choices for 1st person × (3 for 2nd ) × (2 for 3rd ) × (1 for 4th.)
n × (n − 1) × (n − 2) × · · · × 2 × 1 = n!
5
Combinations
6
Counting outcomes
That is, now many ways can we choose two locations from four:
{First, Second, Third, Fourth}?
n 4
There are = ways!
k 2
7
Verify
8
pmf
2 choices for 1st ×(2 for 2nd )×(2 for 3rd )×(2 for 4th ) = 24 = 16.
9
Using counting rules to determine probabilities
4! 4! 4
= = = “4 choose 2”
2! 2! 2! (4 − 2)! 2
=6
= the number of ways to arrange 2 heads among 4 flips
S = HHHH,
HHHT , HHTH, HTHH, THHH,
HHTT , HTHT , HTTH, THTH, TTHH, THHT ,
HTTT , THTT , TTHT , TTTH,
TTTT .
10
Using counting rules to determine probabilities
4
The number of ways to arrange x heads among 4 flips is .
x
11
Using counting rules to determine probabilities
4
The number of ways to arrange x heads among 4 flips is .
x
11
Using counting rules to determine probabilities
Note that in real life, it’s not quite true that the probability of
having a boy P(M) is equal to the probability of having a girl
P(F ).
If P(M) 6= P(F ),
What is P(FMFF )?
12
Using counting rules to determine probabilities
What is P(FMFF )?
P(FMFF ) = P(MFF | F ) × P(F )
13
Using counting rules to determine probabilities
What is P(FMFF )?
P(FMFF ) = P(MFF | F ) × P(F )
= P(MFF ) × P(F ) (∗)
13
Using counting rules to determine probabilities
What is P(FMFF )?
P(FMFF ) = P(MFF | F ) × P(F )
= P(MFF ) × P(F ) (∗)
= [P(FF | M) × P(M)] × P(F )
13
Using counting rules to determine probabilities
What is P(FMFF )?
P(FMFF ) = P(MFF | F ) × P(F )
= P(MFF ) × P(F ) (∗)
= [P(FF | M) × P(M)] × P(F )
= P(FF ) × P(M) × P(F ) (∗)
13
Using counting rules to determine probabilities
What is P(FMFF )?
P(FMFF ) = P(MFF | F ) × P(F )
= P(MFF ) × P(F ) (∗)
= [P(FF | M) × P(M)] × P(F )
= P(FF ) × P(M) × P(F ) (∗)
= [P(F | F ) × P(F )] × P(M) × P(F )
13
Using counting rules to determine probabilities
What is P(FMFF )?
P(FMFF ) = P(MFF | F ) × P(F )
= P(MFF ) × P(F ) (∗)
= [P(FF | M) × P(M)] × P(F )
= P(FF ) × P(M) × P(F ) (∗)
= [P(F | F ) × P(F )] × P(M) × P(F )
= P(F ) × P(F ) × P(M) × P(F ) (∗)
13
Using counting rules to determine probabilities
What is P(FMFF )?
P(FMFF ) = P(MFF | F ) × P(F )
= P(MFF ) × P(F ) (∗)
= [P(FF | M) × P(M)] × P(F )
= P(FF ) × P(M) × P(F ) (∗)
= [P(F | F ) × P(F )] × P(M) × P(F )
= P(F ) × P(F ) × P(M) × P(F ) (∗)
3
= P(F ) × P(M)
(∗) by independence of gender by birth order
13
Using counting rules to determine probabilities
What is P(FMFF )?
P(FMFF ) = P(MFF | F ) × P(F )
= P(MFF ) × P(F ) (∗)
= [P(FF | M) × P(M)] × P(F )
= P(FF ) × P(M) × P(F ) (∗)
= [P(F | F ) × P(F )] × P(M) × P(F )
= P(F ) × P(F ) × P(M) × P(F ) (∗)
3
= P(F ) × P(M)
(∗) by independence of gender by birth order
4
Finally, P(X = 3) = P(F )3 P(M)
3
13
Using counting rules to determine probabilities
then P(M) = 1 − p,
14
Using counting rules to determine probabilities
4
P(X = 3) = P(F )3 P(M)1
3
4
= p 3 (1 − p)4−3 = 6 p 3 (1 − p)
3
P(X = 0) =
P(X = 1) =
P(X = 2) =
P(X = 4) =
15
Using counting rules to determine probabilities
4
P(X = 3) = P(F )3 P(M)1
3
4
= p 3 (1 − p)4−3 = 6 p 3 (1 − p)
3
4
P(X = 0) = p 0 (1 − p)4−0 = (1 − p)4
0
P(X = 1) =
P(X = 2) =
P(X = 4) =
15
Using counting rules to determine probabilities
4
P(X = 3) = P(F )3 P(M)1
3
4
= p 3 (1 − p)4−3 = 6 p 3 (1 − p)
3
4
P(X = 0) = p 0 (1 − p)4−0 = (1 − p)4
0
4
P(X = 1) = p 1 (1 − p)4−1 = 4 p (1 − p)3
1
P(X = 2) =
P(X = 4) =
15
Using counting rules to determine probabilities
4
P(X = 3) = P(F )3 P(M)1
3
4
= p 3 (1 − p)4−3 = 6 p 3 (1 − p)
3
4
P(X = 0) = p 0 (1 − p)4−0 = (1 − p)4
0
4
P(X = 1) = p 1 (1 − p)4−1 = 4 p (1 − p)3
1
4
P(X = 2) = p 2 (1 − p)4−2 = 4 p 2 (1 − p)2
2
P(X = 4) =
15
Using counting rules to determine probabilities
4
P(X = 3) = P(F )3 P(M)1
3
4
= p 3 (1 − p)4−3 = 6 p 3 (1 − p)
3
4
P(X = 0) = p 0 (1 − p)4−0 = (1 − p)4
0
4
P(X = 1) = p 1 (1 − p)4−1 = 4 p (1 − p)3
1
4
P(X = 2) = p 2 (1 − p)4−2 = 4 p 2 (1 − p)2
2
4
P(X = 4) = p 4 (1 − p)4−4 = p 4
4
15
Using counting rules to determine probabilities
Does this agree with our earlier work when P(F ) = p(M) = 0.5?
16
Bernoulli and binomial probability distributions
17
Bernoulli and binomial probability distributions
f (x) =
18
Bernoulli and binomial probability distributions
f (x) =
18
Bernoulli and binomial probability distributions
18
The Binomial Expansion
In general,
n
n
X n
(w + y ) = (w + y )(w + y ) . . . (w + y ) = w x y n−x
| {z } x
x=0
n factors
General idea:
w 5 y 3 = wwwwwyyy = wwwwywyy = · · · = yyywwwww
20
The Binomial Expansion
In general,
n
n
X n
(w + y ) = (w + y )(w + y ) . . . (w + y ) = w x y n−x
| {z } x
x=0
n factors
General idea:
w 5 y 3 = wwwwwyyy = wwwwywyy = · · · = yyywwwww
21
Multiple pmfs, Same Sample Space
x 0 1 2 3 4
f (x) 1/16 4/16 6/16 4/16 1/16
y
f (y )
z
f (z) 22
Multiple pmfs, Same Sample Space
x 0 1 2 3 4
f (x) 1/16 4/16 6/16 4/16 1/16
y 0
f (y ) 8/16
z
f (z) 22
Multiple pmfs, Same Sample Space
x 0 1 2 3 4
f (x) 1/16 4/16 6/16 4/16 1/16
y 0 1
f (y ) 8/16 4/16
z
f (z) 22
Multiple pmfs, Same Sample Space
x 0 1 2 3 4
f (x) 1/16 4/16 6/16 4/16 1/16
y 0 1 2 3 4
f (y ) 8/16 4/16 2/16 1/16 1/16
z
f (z) 22
Multiple pmfs, Same Sample Space
x 0 1 2 3 4
f (x) 1/16 4/16 6/16 4/16 1/16
y 0 1 2 3 4
f (y ) 8/16 4/16 2/16 1/16 1/16
z 0
f (z) 11/16 22
Multiple pmfs, Same Sample Space
x 0 1 2 3 4
f (x) 1/16 4/16 6/16 4/16 1/16
y 0 1 2 3 4
f (y ) 8/16 4/16 2/16 1/16 1/16
z 0 1
f (z) 11/16 5/16 22
Probability Histograms
x 0 1 2 3 4
f (x) 1/16 4/16 6/16 4/16 1/16
y 0 1 2 3 4
f (y ) 8/16 4/16 2/16 1/16 1/16
z 0 1
f (z) 11/16 5/16
0.6
0.6
0.6
f(x)=probability
f(y)=probability
f(z)=probability
0.4
0.4
0.4
0.2
0.2
0.2
0.0
0.0
0 2 4 0 2 4 0.0 0 2 4 23
Recall: Mean
mean of X = E [X ]
X
= xP(X = x)
all x
X
= xf (x)
all x
=µ
24
Expected Value (Mean of a r.v.)
0.4
0.2
0.0
0 1 2 3 4
y
E (Y ) =
25
Expected Value (Mean of a r.v.)
0.4
0.2
0.0
0 1 2 3 4
4
X y
E (Y ) = yf (y )
y =0 25
Expected Value (Mean of a r.v.)
The random
variable Z is a Bernoulli r.v.
1 if more female children than male
Z=
0 otherwise
z 0 1
f (z) 11/16 5/16
f(z)=probability
0.0 0.4
0 1 2 3 4
z
Make a guess. Approximate the average outcome for Z .
E (Z ) =
26
Expected Value (Mean of a r.v.)
The random
variable Z is a Bernoulli r.v.
1 if more female children than male
Z=
0 otherwise
z 0 1
f (z) 11/16 5/16
f(z)=probability
0.0 0.4
0 1 2 3 4
z
Make a guess. Approximate the average outcome for Z .
1
X
E (Z ) = zf (z) = (0)11/16 + (1)5/16 = 5/16.
z=0 26
Expected Value of a Bernoulli Random Variable
z 0 1
Probability mass function (PMF):
f (z) (1 − p) p
where p = 5/16 = probability of a success.
X 1
X
E (Z ) = z fZ (z) = z p z (1 − p)1−z
all z z=0
29
The Binomial Distribution
Mean of Binomial RV
If X is a Binomial(n, p) random variable, E (X ) = np.
X
E (X ) = x f (x)
all x
n
X n
= x p x (1 − p)n−x
x
x=0
= np
32