Date post: | 13-Nov-2015 |
Category: |
Documents |
Upload: | sugam-khetrapal |
View: | 226 times |
Download: | 2 times |
STAT 2Lecture 19:
Binomial probabilities
This week
The binomial formula The law of averages Expected value and standard error The normal approximation
I
A reminder: tossing coins
Tossing coins
I toss three coins. What's the probability that exactly two out of three are heads?
Draw a tree
Using the tree
P(HHT) = * * = 1/8P(HTH) = * * = 1/8P(THH) = * * = 1/8P(2 heads out of 3) = 3/8 Note that there are three ways of
getting two heads in three tosses Each way has equal probability
Why are there 3 ways?
Number of tosses is fixed at 3 There needs to be two heads and
one tail (can only get head or tail) The tail can fall on any of the three
tosses So there are three places the tail
can be
Why are the probabilities the same for each way? Probability of getting a head
doesn't change from toss to toss Tosses are independent Each way has probability
* *
II
Tossing a biased coin
Tossing a biased coin
I have a biased coin which has a 60% chance of coming up heads. I toss it three times.
What's the probability that exactly two out of three are heads?
Drawing the tree
Using the tree
P(HHT) = .6*.6*.4 = 0.144P(HTH) = .6*.4*.6 = 0.144P(THH) = .4*.6*.6 = 0.144P(2 H out of 3) = 3 * 0.144 = 0.432 There are three ways of getting
two heads in three tosses Each way has equal probability
Why are the probabilities the same for each way? P(HHT) = .6*.6*.4 = 0.144 P(HTH) = .6*.4*.6 = 0.144 P(THH) = .4*.6*.6 = 0.144 Tosses indep., probs don't change The probability of each way is
found by multiplying P(H)*P(H)*P(T) in some order
III
Tossing a lot of biased coins
Tossing biased coins
I have a biased coin which has a 60% chance of coming up heads. I toss it five times.
What's the probability that exactly three out of five are heads?
Tossing biased coins
Will take a long time to draw out the whole tree
Can find the probability by multiplying the number of ways by the probability of each way
What's the probability of one way?
Each way has three heads and two tails; probability of each way will be found by multiplying P(H)*P(H)*P(H)*P(T)*P(T) in some order
P(one way) = .6*.6*.6*.4*.4 = (0.6)3*(0.4)2 = 0.03456
How many ways are there?
How many ways are there of arranging 3H's and 2T's?
Can list them all:HHHTT HHTHT HHTTH HTHHTHTHTH HTTHH THHHT THHTHTHTHH TTHHH 10 ways
Find the probability
10 ways P(one way) = 0.03456 P(three heads in five tosses)
= 10 * 0.03456 = 0.3456 = 34.56%
Quite a lot of work: maybe there's a formula or something?
IV
Tossing way too many biased coins
Tossing biased coins
I have a biased coin which has a 60% chance of coming up heads. I toss it eight times.
What's the probability that exactly four out of eight are heads?
What's the probability of one way?
Probability of each way will be found by multiplying P(H)*P(H)*P(H)*P(H)*P(T)*P(T) *P(T)*P(T)
P(one way) = (0.6)4*(0.4)4 = 0.003318
How many ways are there?
Too many ways to list; need to count them without listing them
Fortunately, there's the binomial coefficient
Number of ways of choosing 4 out of 8 objects is:
(8*7*6*5*4*3*2*1)/(4*3*2*1*4*3*2*1)
Find the probability
(8*7*6*5*4*3*2*1)/(4*3*2*1*4*3*2*1) Number of ways is
(8*7*6*5*4*3*2*1)/(4*3*2*1*4*3*2*1) = 70
P(one way) = 0.003318P(4 H out of 8) = 70 * .003318
= 0.2322 = 23.22%
Where did that binomial coefficient come from? Say you have 4 different heads:
H1 H2 H3 H4; and 4 different tails: T1 T2 T3 T4
How many ways are there of arranging these 8 coins?
8 ways of picking the first coin, then 7 of picking the second given the first, then 6 of the third...
Where did that binomial coefficient come from? If there are 8 different objects, then
there are 8*7*6*5*4*3*2*1 ways of arranging them
We write this as 8! (pronounced eight factorial)
Where did that binomial coefficient come from? Now, we don't have 8 different
objects: the four head are the same. How many times are we counting each set of four heads?
Think about the orders that the four heads could be in
Where did that binomial coefficient come from? The four heads (H1, H2, H3, H4)
could be in any of 4! different orders
So we're counting each way 4! times
Need to divide number of ways by 4!
Where did that binomial coefficient come from? But the four tails could be in any
of 4! different orders Then number of ways is 8!/(4!4!)=
(8*7*6*5*4*3*2*1)/(4*3*2*1*4*3*2*1) = 70
V
The binomial formula
The binomial formula
The probability of some event happening on one trial is p
I perform n independent trials What is the chance of the event
happening exactly k times in n trials?
Number of times the event occurs has a binomial distribution
The binomial formula
P(k out of n)= (no. of ways) * (prob of each way)
= n!k ! nk !pk 1 pnk
When can you use the binomial formula?We want to know how many times
something does or doesn't happene.g. rolling a die multiple times: - can use binomial if we want to
know number of sixes - can't use binomial if we want to
know sum of rolls
When can you use the binomial formula? n, the number of trials, must be
fixed in advance p, the probability of success on
one trial, doesn't change Trials must be independent
Why can't you use the binomial formula? I toss a coin until I get a tail.
What's the probability that I get exactly two heads?
I draw three cards from a shuffled deck. What's the chance that exactly two of the cards are spades?
Example: counting sixes
I roll a die ten times. What's the probability I get exactly one six?
Example: counting sixes
Use formula:=
=
= = 32.30%
10 !1 ! 9! 16
1
56 9
109876543211987654321 16
1
56 9
1016 1
56 9
Counting sixes: a note
I roll a die ten times. What's the probability I get no sixes?
i.e. same formula as the power rule
10 !0 !10 ! 16
0
56 10
=156 10
Using the addition rule
I roll a die ten times. What's the probability I get exactly two sixes or fewer?
Can add up P(no sixes) + P(one six) + P(two sixes); find each of these probabilities using the binomial formula
Using the addition rule
P(no sixes) = = 16.15%
P(one six) = = 32.30%
P(two sixes) = = 29.07%
P(no more than 2 sixes) = 77.52%
1016 1
56 9
56 1 0
10 !2 ! 8 ! 16
2
56 8
VI
Is it unusual?
Is it unusual?
I toss a coin six times and get five tails. Is this unusual?
P(5 or more tails)= P(5 tails) + P(6 tails)= 6(1/2)5(1/2)1 + (1/2)6
Is it unusual?
I toss a coin six times and get five tails. Is this unusual?
P(5 or more tails)= P(5 tails) + P(6 tails)= 6(1/2)5(1/2)1 + (1/2)6 = 10.94% Not that unusualNB: P(5 or more heads) = 10.94%
Is it unusual?
I toss a coin twelve times and get ten tails. Is this unusual?
P(10 or more tails) = P(10 tails) + P(11 tails) + P(12 tails)
= 66(1/2)12 + 12(1/2)12 + (1/2)12 = 1.93%
Unusual: maybe the coin is biased
Is it unusual?
I toss a coin 24 times and get 20 tails. Is this unusual?
P(20 or more tails) = 0.077%, or 1 in 1300
Very unusual: strongly suspect the coin is biased
Recap
The binomial formula The probability of some event
happening on one trial is p I perform n independent trials What is the chance of the event
happening exactly k times in n trials?
Number of times the event occurs has a binomial distribution
The binomial formula
P(k out of n)= (no. of ways) * (prob of each way)
= n!k ! nk !pk 1 pnk
When can you use the binomial formula?We want to know how many times
something does or doesn't happene.g. rolling a die multiple times: - can use binomial if we want to
know number of sixes - can't use binomial if we want to
know sum of rolls
When can you use the binomial formula? n, the number of trials, must be
fixed in advance p, the probability of success on
one trial, doesn't change Trials must be independent
Tomorrow:
The law of averages
Slide 1Slide 2Slide 3Slide 4Slide 5Slide 6Slide 7Slide 8Slide 9Slide 10Slide 11Slide 12Slide 13Slide 14Slide 15Slide 16Slide 17Slide 18Slide 19Slide 20Slide 21Slide 22Slide 23Slide 24Slide 25Slide 26Slide 27Slide 28Slide 29Slide 30Slide 31Slide 32Slide 33Slide 34Slide 35Slide 36Slide 37Slide 38Slide 39Slide 40Slide 41Slide 42Slide 43Slide 44Slide 45Slide 46Slide 47Slide 48Slide 49Slide 50Slide 51