Stat 211 Week Five The Binomial Distribution
Last Week E x E x = x p(x) = n p σ x = x μ x 2 p(x) We will see this again soon!!
Binomial Experiment We have an experiment with the following qualities : 1. A fixed number of trials. 2. Each trial has a result of either success or failure. 3. P(success) is the same for every trial. 4. Each trial is independent of all others. 5. X = # of successes So X count the successes.
Is it Binomial! Flip a coin 30 times, the side that lands upward is observed (we want to flip heads). 1. 30 trials 2. Success = Heads, Failure = Tails 3. P(Success) = 0.5 on every trial. 4. Trials are independent, flips don t affect each other. 5. X = Side that lands up (can equal an H or a T) Does not count number of successes.
Is it Binomial! Flip a coin 30 times, the side that lands upward is observed (we want to flip heads). This is NOT a Binomial Experiment!!!
Is it Binomial! Roll a die 24 times, the number of 6 s is observed. 1. 24 trials 2. Success = 6, Failure = Anything else 3. P(Success) = 1 on every trial. 6 4. Trials are independent, rolls don t affect each other. 5. X = # of 6 s = Number of successes
Is it Binomial! Roll a die 24 times, the number of 6 s is observed. This is a Binomial Experiment!!! We meet all of the criteria!
Binomial Distribution We let X = # successes in a binomial experiment. From this we say : X ~ Binomial(n, p) X ~ B (n, p) p = P(success per trial)
Mean and St. Dev. for Binomial Our mean for Binomial E x = μ x = n p Our standard deviation for Binomial SS x = σ x = n p (1 p)
Example of Mean/St. Deviation X ~ Binomial(n = 4, p = ½) E x = μ x = n p E x = μ x = 4 1 = 2 2 SS x = σ x = n p (1 p) SS x = σ x = 4 1 2 (1 1 2 ) = 1 = 1
Ideas from last week E x = μ x = x p(x) x p(x) 0 1 2 1 4 6 16 16 16 3 4 4 1 16 16 E x = 0 1 16 + 1 4 16 + 2 6 16 + 3 4 16 + 4 1 16 = 32 16 = 2
More Ideas from Last Week SS x = σ x = x μ x 2 p(x) x p(x) 0 1 2 1 16 4 16 3 4 V x = 0 2 2 1 + 1 2 2 4 16 16 + 2 2 2 6 + 3 2 2 4 + 4 2 2 1 16 16 6 16 4 16 1 16 V x = 4 16 + 4 16 + 0 16 + 4 16 + 4 16 = 16 16 = 1 SS x = V(x) = 1 = 1 16
Notice We get the same results both way!!! But, using the Binomial equations is way way way easier!!!! It is a shortcut.
Another Example X Binomial(n = 480, p = 1 6 ) μ x = E x = n p = 480 1 6 = 80 σ x = n p (1 p) = 480 1 6 5 6 = 66.7 σ x = 8.2
Binomial Probabilities What if we have a Binomial experiment and we want to calculate the probability of a certain number of successes (counted as X) of occurring? There s a formula for that!!! P X = x = n x px 1 p n x X = # successes x = # of successes of interest
Binomial Formula Explained P X = x = CCCCCCCCCCC, hoo mmmm wwww ccc ww haaa x mmmm sssssssss n x px 1 p n x ppppppppppp oo sssssss mmmmmmmmmm x ttttt ppppppppppp oo fffffff mmmmmmmmmm n x ttttt
Example of the Formula #1 A coin is tossed 3 times, find P(2 Heads). Sample space : {HHH, HHT, HTH, THH, TTH, THT, HTT, TTT} what we want! P 2 HHHHH = # sssssss ppppppppppppp # ttttt ppppppppppppp = 3 8
Example #1 Continues We want P(2 Heads), this is P(Successes = 2) or P(X = 2). The experiment is Binomial! (Use the formula!) X ~ B(n = 3, p = ½ ) P X = 2 = 3 2 1 2 2 1 2 1 = 3 1 2 1 2 1 = 3 2 8 The same as we saw with the other method.
Formula Example #2 X ~ Binomial(n = 10, p = 1 5 ) Find P(X = 3) P X = 3 = 10 3 1 5 3 4 5 7 = 120 1 125 16384 78125 = 0.201
Something a Little Different What if we aren t interested in an exact number of successes, but in a range of successes. For instance seven or fewer sucesses. We want P(X 7). One way is to add up all of the probabilities in this grouping. P X 7 = P(0 1 2 3 4 5 6 7) = P 0 + P 1 + P 2 + P 3 + P 4 + P 5 + P 6 + P 7 Each of the smaller components can be found with the formula.
Why That is Possible Finding the probabilities of each piece of the group comes from our probability laws. P(A B) = P(A) + P(B) P(A B) In our case the pieces are all mutually exclusive, so we can just add the probabilities of each component without worrying about any overlap.
Too Much Effort Doing a problem that way is possible but not feasible. There is an easier way!!! The table.
Using the Table Example #1 X ~ Binomial(n=10, p=0.5) P X 3 = P 0 + P 1 + P 2 + P 3 P 0 = 10 0 1 2 0 1 2 10 = 1 1 2 0 1 2 10 = 0.0009 P 1 = 10 1 1 2 1 1 2 9 = 10 1 2 1 1 2 9 = 0.0097 P 2 = 10 2 1 2 2 1 2 8 = 45 1 2 2 1 2 8 = 0.0439 P 3 = 10 3 1 2 3 1 2 7 = 120 1 2 3 1 2 7 = 0.117 P(X 3) = 0.0009 + 0.0097 + 0.0439 + 0.117 = 0.1715
Example #1 Continued Look in the table. P(X 3) = 0.1719. These are really close, but not perfect which is OK! Usually they will be close but not perfectly matched, this mainly happens due to rounding error in the first approach or due to any rounding in the table itself.
Using the Table Example #2 X ~ Binomial(n=10, p= ½ ) Find P(X 2) From the table we get 0.9730 The tables are important, we will being using several different tables throughout the remainder of the semester.
Forgoing the Formula X ~ Binomial(n=10, p= ½ ) Find P(X = 3) Suppose I don t want to use the formula, I can use the table instead. How? P(X=3) = P(0) + P(1) + P(2) + P(3) - P(0) - P(1) - P(2)
Forgoing the Formula X ~ Binomial(n=10, p= ½ ) Find P(X = 3) Suppose I don t want to use the formula, I can use the table instead. How? P(X=3) = P(0) + P(1) + P(2) + P(3) - P(0) - P(1) - P(2) This is the same as : P(X 3) P(X 2)
Forgoing the Formula Using the formula : P X = 3 = 10 3 Using the table : P(X 3) = 0.1719 P(X 2) = 0.0547 1 2 3 1 2 7 = 0.117 P(X = 3) = 0.1719 0.0547 = 0.1172 They are super duper close, YAY!!!
What about >? P(X > 2) (where n = 5) P(X > 2) = P(3 4 5) = P(3) + P(4) + P(5) We could do this in pieces, but that is a pain. (>.<) We need another way!!!
A better way for > Remember the sample space, in this case it is : {0, 1, 2, 3, 4, 5} P(Sample Space) = 1 = P(0) + P(1) + P(2) + P(3) + P(4) + P(5) Remember compliment. If we want P(not E) we use 1 P(E), we can use that here. P(X > 2) = 1 P(X 2)
Proof that it works!!! 1 P(X 2) P(Sample Space) P(X 2) = P(0) + P(1) + P(2) + P(3) + P(4) + P(5) - P(0) - P(1) - P(2) = P(0) + P(1) + P(2) + P(3) + P(4) + P(5) - P(0) - P(1) - P(2) = P(3) + P(4) + P(5) = P(X > 2)
Example for > (or even *gasp*) X ~ Binomial(n = 5, p = 0.3) P(X 3) = P(X > 2) = P(3) + P(4) + P(5) P 3 = 5 3 0.3 3 0.7 2 = 0.132 P 4 = 5 4 0.3 4 0.7 1 = 0.028 P 5 = 5 5 0.3 5 0.7 0 = 0.002 P(X 3) = 0.132 + 0.028 + 0.002 = 0.162 P(X 3) = 1 - P(X 2) = 1 0.8369 = 0.1613 close
What about in between? P 2 X 4 = P(X = 2) + P(X = 3) + P(X = 4) We could do this by hand but this would be difficult with larger numbers. We can also use the table. Let s think! P(X 4) = P(0) + P(1) + P(2) + P(3) + P(4) This contains all of what we want plus some extra. Subtract out what we don t want. P(0) + P(1) we don t want. This is the same as P(X 1).
Flipping Success and Failure The Binomial table has a maximum p of 0.5. Males have a 0.7 chance of marrying. We take a sample of 25 males. What is the probability that 20 or more males marry? P(X 20) =? X = # males that marry. Let Y = # males that do not marry.
Flipping Continued We want P(X 20), put it in terms of Y. P(X 20) = P(Y 5) X ~ Binomial(n = 25, p = 0.7) Y ~ Binomial(n = 25, p = 0.3) Use the table! P(Y 5) = 0.1935 = P(X 20)
Weird Words Probability questions are often word questions. More than > Less than < or more or less At most At least
Be Careful When Flipping P(X > 3) = 1 P(X 3) P(X 3) = 1 P(X 2) Think before you flip!!!!!
Extra Example A student is taking a multiple choice exam with 16 questions, and guessing at the answers. Each question has 4 possible answers, A, B, C, D. Each question is independent. Is this a binomial distribution? Fixed number of trials, n = 16 Either the answer is right or wrong. (success/failure) p = probability of success = ¼ Trials are independent. Let X = # of correct answers. Yes, this is binomial.
Extra Example A student is taking a 16 question multiple choice exam, and guessing at the answers. There are four choices per question, A, B, C,D. What is the expected number that he/she will get right? 16 questions 16 trials Probability of success per question = ¼ E(x) = n p = 16(¼) = 4 correct answers
Extra Example A student is taking a multiple choice exam with 16 questions, and guessing at the answers. Each question has 4 possible answers, A, B, C, D. Each question is independent. Is this a binomial distribution? What is the standard deviation? σ x = n p (1 p) = 16 σ x 1.732 1 3 = 3 4 4
Extra Example What is the probability that the student will get 8 questions correct? P(x= 8) = P(x 8) P(x 7) = 16 8 1 4 8 1 1 4 16 8 8 3 4 8 = 12870 1 4 = 0.0197
Extra Example What is the probability that the student will get less than 8 correct? P(x < 8) = P(x 7) = P(0) + P(1) + P(2) + + P(7) From the table we can find that P(x 7) = 0.9729
What is the probability that the student will get less than 8 correct? P(x < 8) = P(x 7) = P(0) + P (1) + P (2) + + P (7) From the table we can find that P(x 7) = 0.9729