Stat 20: Intro to Probability and Statistics Lecture 13: Binomial Formula Tessa L. Childers-Day UC Berkeley 14 July 2014
By the end of this lecture... You will be able to: Calculate the ways an event can occur, without writing out each possibility Determine whether an event fits the binomial framework Utilize the Binomial Formula to calculate probabilities 2 / 27
Probability Rules We have learned several rules to help us calculate probabilities Complement Rule Multiplication Rule Addition Rule 3 / 27
Some Sample Problems 1 You are flipping a fair coin. What is the chance that in 5 flips, exactly 4 heads are seen? 2 You are flipping a fair coin. What is the chance that in 10 flips, exactly 4 heads are seen? 3 You are rolling a fair die. What is the chance that in 4 rolls, a 3 is rolled exactly twice? 4 You are rolling a fair die. What is the chance that in 15 rolls, a 3 is rolled exactly twice? What do these chances have in common? When are they easy (difficult) to calculate? Which parts are easy (difficult) to calculate? 4 / 27
Formalizing this relationship: If we have multiple trials of a single event (rolling a die, tossing a coin, etc.), each of which is independent, and can be viewed as either a success or failure, then P(k successes in n trials) = (# of ways) P(success) k [1-P(success)] (n k) So we need to figure out how to count the number of arrangements 5 / 27
Fully Ordering a List Say you have 3 students, and you want to arrange them in their 3 seats. How many ways are there to do this? 6 / 27
Fully Ordering a List (cont.) Now a new student comes. How many ways are there to arrange the 4 students in their 4 seats? 7 / 27
Fully Ordering a List (cont.) Now 2 more new students arrive. How many ways are there to arrange the 6 students in their 6 seats? 8 / 27
Fully Ordering a List (cont.) Say we have n students, and we want to arrange them in their n seats. How many ways are there to do this? 9 / 27
Incompletely Ordering a List Say we have 3 students, but only two seats. One student must remain standing. How many ways are there to arrange the 3 students in the 2 seats? 10 / 27
Incompletely Ordering a List (cont.) Now a new student comes. How many ways are there to arrange the 4 students in the 2 seats? 11 / 27
Incompletely Ordering a List (cont.) Now 2 more new students arrive. How many ways are there to arrange the 6 students in the 2 seats? 12 / 27
Incompletely Ordering a List (cont.) Say we have n students, and we want to arrange them in k seats. How many ways are there to do this? 13 / 27
Choosing From a List (but NOT ordering) Say we have 3 students, but only two seats. One student must remain standing. How many ways are there for the three students to sit in the 2 seats, disregarding order? 14 / 27
Choosing From a List (but NOT ordering) (cont.) Now a new student comes. How many ways are there for 4 students to sit in 2 seats, disregarding order? 15 / 27
Choosing From a List (but NOT ordering) (cont.) Now 2 new students come. How many ways are there for 6 students to sit in 2 seats, disregarding order? 16 / 27
Choosing From a List (but NOT ordering) (cont.) Say we have n students. How many ways are there for n students to sit in k seats, disregarding order? 17 / 27
Counting Successes and Failures Suppose we repeat an experiment n times, each time recording a success or failure. How many different ways are there to have k successes in the n trials? # of ways to get k successes in n trials = n! k!(n k)! 18 / 27
Probability of a Certain Way n! We know that there are ways to get k successes from n k!(n k)! trials. What is the probability of one of these ways occurring? For example, P(first k successes, followed by n k failures) =? 19 / 27
Probability of a Certain Way (cont.) Let s say that p is the probability of success. What is the probability of failure? Recall that these trials are separate independent. P(first k successes, followed by n k failures) = p p p (1 p) (1 p) (1 p) = p k (1 p) n k 20 / 27
Probability of All Ways We know: n! There are ways to get k successes from n trials k!(n k)! The probability of a certain one of these ways occurring is p k (1 p) (n k). What is the probability of any one of these ways occurring? P(any k successes and any n k failures in n trials) =? 21 / 27
Probability of All Ways (cont.) Each way is mutually exclusive (two ways cannot occur at the same time) P(any k successes and any n k failures in n trials) = p k (1 p) n k + p k (1 p) n k + + p k (1 p) n k = n! k!(n k)! pk (1 p) (n k) This is the binomial formula. 22 / 27
Summary To use the binomial formula, we must check that: There are n trials (known ahead of time) Each trial is independent Each trial can end in one of two outcomes (success or failure) Each trial has the same probability of success (p) and failure (1 p) If these conditions are met, then we can find the chance of getting exactly k successes and n k failures as P(k successes and n k failures in n trials) = n! k!(n k)! pk (1 p) (n k) 23 / 27
Examples Can we use the binomial formula in the following situations? If so, what are n, p and k? 1 We roll a dice 10 times, and want to know the probability of rolling 5 2 s 2 We want to know the probability that it takes 10 rolls of the dice to see 5 2 s 3 We toss a coin 5 times, and want to know the probability of seeing 4 or fewer heads 4 We draw 10 tickets without replacement from a box with 12 3 s, 8 6 s, and 4 7 s. We want to find the probability of drawing more than 5 3 s. 5 We draw 10 tickets with replacement from the box above. We want to know the probability of drawing exactly 3 tickets with prime numbers on them. 24 / 27
Examples (cont.) A fair coin is flipped 5 times. If possible, use the binomial formula to find the chance that we see: 1 2 tails 2 At least 4 heads 3 1 or fewer tails 4 At most 4 tails 5 Exactly 4 heads 6 Exactly 1 head 25 / 27
Examples (cont.) 10 tickets are drawn with replacement from a box with 12 3 s, 8 6 s, and 4 7 s. If possible, use the binomial formula to find the chance that we draw: 1 Exactly 3 6 s 2 Exactly 5 6 s or 7 s 3 At least 2 7 s 4 Exactly 3 3 s, 2 4 s, and 5 7 s 26 / 27
Important Takeaways Counting formulas can save us time The Binomial Formula can be used to calculate probabilities when There are only two outcomes (success/failure) The number of trials are known ahead of time (n) The trials are independent Each trial has the same probability of success (p) In that case: n! P(k successes and n k failures in n trials) = k!(n k)! pk (1 p) (n k) We must diligently check that the conditions are met to use the binomial formula Next time: Midterm Review. Come with questions to ask (either specific problems or conceptual issues). 27 / 27