Professional Documents
Culture Documents
Binomial Distribution & Bayes' Theorem
Binomial Distribution & Bayes' Theorem
Bayes Theorem
Questions
What is a probability?
What is the probability of obtaining 2
heads in 4 coin tosses? What is the
probability of obtaining 2 or more
heads in 4 coin tosses?
Give an concrete illustration of p(D|H)
and p(H|D). Why might these be
different?
Probability of success = p
p(success) = p
Probability of failure = q
p(failure) = q
p+q = 1
q = 1-p
Probability long run relative
frequency
HH
HT
TH
TT
Sample space shows 4 possible outcomes or
sequences. Each sequence is a permutation.
Order matters.
There are 2 ways to get a total of one heads (HT
and TH). These are combinations. Order does
NOT matter.
3 flips
HHH,
HHT, HTH, THH
HTT, THT, TTH
TTT
All permutations equally likely = p*p*p
= .53 = .125 = 1/8.
p(1 Head) = 3/8
Factorials: N!
4! = 4*3*2*1
3! = 3*2*1
N
N!
Combinations: NCr
r r!( N r )!
The number of ways of selecting r combinations of N objects,
regardless of order. Say 2 heads from 5 trials.
5
5!
5 x 4 x3 x 2 x1
5 x 2 10
2 2!(5 2)! (2 x1)(3 x 2 x1)
Binomial Distribution 1
N r N r
p ( x r ; N , p ) p q , r 1,2,...N
r
Binomial 2
5
4
3
2
1
0
N r N r
p ( x r ; N , p ) p q , r 1,2,...N
r
5 5
p ( X 5; N 5, p .5) p .55
5
5 4 1
p ( X 4; N 5, p .5) p q 5 p 4 q
4
5 3 2
p ( X 3; N 5, p .5) p q 10 p 3 q 2
3
5 2 3
p ( X 2; N 5, p .5) p q 10 p 2 q 3
2
5 1 4
p ( X 1; N 5, p .5) p q 5 p1q 4
1
5 0 5
p ( X 0; N 5, p .5) p q q 5
0
.03125
.15625
.3125
.3125
.15625
.03125
Binomial 3
Flip coins and compare observed to
expected frequencies
Binomial 4
Find expected frequencies for number
of 1s from a 6-sided die in five rolls.
Binomial 5
200
100
0
0
4
6
Number Heads
10
Review
What is a probability?
What is the probability of obtaining 2
heads in 4 coin tosses? What is the
probability of obtaining 2 or more
heads in 4 coin tosses?
p( y | H 0 ) p( H 0 )
p ( H 0| y )
p( y | H 0 ) p( H 0 ) p( y | H1 ) p( H1 )
p (.6 | y )
(.088)(.75)
.704
(.088)(.75) (.111)(.25)
Review