S2 Chapter 1: Binomial Distribution Dr J Frost (jfrost@tiffin.kingston.sch.uk) www.drfrostmaths.com Last modified: 30th August 2015 Probability Distributions In S1 we saw that a random variable has an associated probability distribution. This had two components: 1 Outcomes expressed as a set 2 A probability distribution which maps outcomes to probabilities Description Throwing a fair die. Number of heads seen after throwing a coin twice. Outcomes Probability Function {1,2,3,4,5,6} 𝑃 𝑋 = 𝑥 ?= 6 for all 𝑥 ? {0,1,2} Note that we said on the left that the count is the outcome, not what each coin was! ? 1 1 𝑃 𝑋=𝑥 = 4 1 2 ? 𝑥 = 0,2 𝑥=1 Off-The-Shelf Probability Distributions We can define the probability function with whatever outcomes and probabilities we like. However, there are certain ‘off-the-shelf’ probability distributions where the probability function is already written for us and formulae are given for 𝐸[𝑋] and 𝑉𝑎𝑟[𝑋] – we have some limited control over them by setting the values of some variables known as ‘parameters’. We encountered two such ‘off-the-shelf’ distributions in S1: These are all based on the parameters we set. Description Name Params Outcomes A Bell-shaped distribution around some known mean with a known variance. Normal Distribution 𝑁 𝜇, 𝜎 2 Mean 𝜇 Variance 𝜎 2 ℝ (Any real value) Each discrete outcome is equally likely to happen. Discrete Uniform Distribution Number of outcomes 𝑛 ? ? ? ? ? {1,2, … , 𝑛} ? Prob Func 𝑝 𝑥 = 1 ? 𝜎 2𝜋 𝑒 − 𝑥−𝜇 2 2𝜎 2 Oddly, this is in your S1 formula sheet, but you never used it! 𝑝 𝑥 = 1 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑥 𝑛 ? (No need to copy this – We will keep expanding this table and coming back to it) 𝑬𝑿 𝑽𝒂𝒓 𝑿 𝜇 𝜎2 ? ? 𝑛+1 2 𝑛2 − 1 12 ? ? Off-The-Shelf Probability Distributions In Chapters 1, 2, and 4, we will gradually explore three new ‘off-the-shelf’ distributions. Don’t worry yet! These are all based on the parameters we set. Description Name Params Outcomes A Bell-shaped distribution around some known mean with a known variance. Normal Distribution 𝐍 𝛍, 𝛔𝟐 Mean 𝜇 Variance 𝜎 2 ℝ (Any real value) Each discrete outcome is equally likely to happen. Discrete Uniform Distribution Number of outcomes 𝑛 We count the number of ‘successes’ after a number of trials, each with two outcomes (‘success’ and ‘failure’). e.g. Number of heads after 10 throws of an unfair coin. Binomial Distribution 𝑩 𝒏, 𝒑 Number of trials 𝑛 Counting the number of events which occur within a fixed time, given some known rate. Poisson Distribution 𝑷 𝝀 Average rate 𝜆 Outcome could be any number within some continuous range 𝑎 to 𝑏 Continuous Uniform Distribution 𝑼 𝒂, 𝒃 Upper and lower limit 𝑎 and 𝑏 Prob Func 𝑝 𝑥 = 1 𝜎 2𝜋 𝑒 − 𝑥−𝜇 2 2𝜎 2 𝑬𝑿 𝑽𝒂𝒓 𝑿 𝜇 𝜎2 𝑛+1 2 𝑛2 − 1 12 𝑛𝑝 𝑛𝑝 1 − 𝑝 𝜆 𝜆 𝑎+𝑏 2 𝑏−𝑎 12 Oddly, this is in your S1 formula sheet, but you never used it! {1,2, … , 𝑛} 0, 1, … , 𝑛 𝑝 𝑥 = 𝑝 𝑥 = 1 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑥 𝑛 𝑛 𝑥 𝑝 1−𝑝 𝑥 𝑥 Probability of success in each trial 𝑝 ℕ (including 0) 𝑎, 𝑏 𝑝 𝑥 =𝑒 𝑝 𝑥 = −𝜆 𝜆𝑥 𝑥! 1 𝑏−𝑎 2 Back in 2010 I was on holiday in Hawaii and visited the family of a friend. We noticed that at the dinner table that out of the 8 of us, 6 of us were left-handed (including myself). One of them asked, “The chances of that must be very low”. I saw that as a challenge. We’ll solve this problem in a sec… S2 – Chapter 2 – Binomial Distribution Lesson 1: Introduction to Combinatorics Factorial and Choose Function Q1 How many ways are there of arranging 5 different coloured beads in a line? There are 5 choices for the first beads. 4 for the second, and so on. So 5 × 4 × 3 × 2 × 1 = 5! = 120 possibilities. ? the number of ways of 𝒏! is the factorial function, and gives us arranging 𝒏 distinguishable objects. Factorial and Choose Function Q2 How many ways are there of arranging 2 red beads and 3 blue beads in a line? We can’t distinguish each of the red beads, nor the blue beads. These 2 arrangements are actually the same! 𝑅1 𝐵1 #1: As before there are 5! ways of arranging the 5 beads. 𝐵2 𝑅2 𝐵3 #3: There are similarly 3! Ways of arranging the blue beads, so we need to divide by 3! 5! #2: However, since there are 2! ways of arranging the red beads, each 2! possibilities represents the same arrangement, so we divide by 2! to account for duplicates. Click for Bromanimation Answer #4: So there are = 10 ways of arranging the beads. 3!2! Another way of thinking about it is that we’re “choosing” 2 of the 5 slots in the line for the red beads to go in. 𝟓 We can write this as said “5 choose 2”. 𝟐 𝑛 𝑛! = is the number of ways of 𝑟! 𝑛−𝑟 ! 𝑟 choosing 𝑟 items from 𝑛 where the order of the items in the choice don’t matter. Test Your Understanding T1 How many ways of arranging the letters in the word TELEVISION? There are 10! ways of arranging 10 distinct things. But the 2! ways of arranging the E’s lead to the same word. And the 2! Ways of arranging the I’s ? lead to the same word. T4 Example sequences: HHTTHTTH, HHHHTTTT, … By the same logic as before, we are choosing 4 of the 8?positions in the 𝟖 sequences to put ‘H’ in, so = 𝟕𝟎 𝟒 possibilities. 𝟏𝟎! = 𝟗𝟎𝟕𝟐𝟎𝟎 𝟐! 𝟐! T2 T3 How many ways of arranging 3 red balls, and 4 green balls in a line? 𝟕! ? = 𝟑𝟓 𝟑! 𝟒! How many ways of arranging 4 red balls, 3 green balls and 2 blue balls in a line? 𝟗! = 𝟏𝟐𝟔𝟎 𝟒! 𝟑! 𝟐!? I throw a coin 8 times. How many possibilities are there in which I threw 4 Heads? T5 If you have 8 people at a dinner table, how many ways are there for 6 of them to be left-handed? We’re counting the possible choices of 6 people out of 8. 𝟖 That’s = 𝟐𝟖 possibilities. 𝟔 ? Exercise 1X (Not in textbook) 1 How many ways are there of arranging 10 5 I’m a waiter serving a table of 10. I have 7 fish dishes (each the same) and 3 veg dishes (each the same). How many ways can meals be served to the table? We can choose 3 people to give the fish dishes to out 𝟏𝟎 of the 10. = 𝟏𝟐𝟎 𝟑 red balls and 5 blue balls in a line. 𝟏𝟓! = 𝟑𝟎𝟎𝟑 𝟏𝟎! 𝟓! ? ? 2 How many ways are there of arranging the letters in the word BANANA? 𝟔! = 𝟔𝟎 𝟑! 𝟐! ? 3 How many sequences can we make consisting of 3 A’s, 4 B’s, and 5 C’s (e.g. ABCCBAACBCC) 𝟏𝟐! = 𝟐𝟕𝟕𝟐𝟎 𝟑! 𝟒! 𝟓! I throw a fair dice 20 times. How many possibilities are 6 there in which I saw a 1 eight times? 𝟐𝟎 = 𝟏𝟐𝟓𝟗𝟕𝟎 𝟖 ? 7 I have 10 different pieces of fruit to pick from. I pick 3, and put them in a line. How many possible lines of fruit are there? 𝟏𝟎 × 𝟑! = 𝟕𝟐𝟎 𝟑 ? 4 Given that in the lottery you pick 6 distinct numbers from 1 to 49, what’s the probability you win the lottery? 𝟒𝟗 There are = 𝟏𝟑𝟗𝟖𝟑𝟖𝟏𝟔 possible 𝟔 𝟏 tickets. So probability is ? 𝟏𝟑𝟗𝟖𝟑𝟖𝟏𝟔 ? 8 Hard: How many possible lottery tickets are there where exactly 3 of the 6 numbers match (given there were again 49 numbers to choose from) 𝟔 possible ways of choosing the 3 numbers 𝟑 𝟒𝟑 which matched. However there are ways of choosing 𝟑 𝟔 𝟒𝟑 the 3 numbers which didn’t match. So × = 𝟑 𝟑 𝟐𝟒𝟔𝟖𝟐𝟎 There are ? Probability based Questions Q A fair die is rolled 8 times. Find the probability of: a) No sixes b) Only 3 sixes c) 4 twos and 4 sixes a Probability of not rolling a six is 5 6 5 𝑃 𝑛𝑜 𝑠𝑖𝑥𝑒𝑠 = 6 ? 8 b 3 were six and 5 weren’t six. If ‘S’ means a six was thrown and ‘N’ means it wasn’t throw, one possibility is 1 3 5 5 6 6 SSNNNSNN, which has probability 8! 8 But there’s = ways of arranging 3 S’s and 5 N’s. So: 3!5! 3 3 5 1 5 8 𝑃 3 𝑠𝑖𝑥𝑒𝑠 = × = 0.104 3 6 6 ? c 1 𝑃 4 𝑡𝑤𝑜𝑠 𝑎𝑛𝑑 4 𝑠𝑖𝑥𝑒𝑠 = 6 = 0.0000417 4 1 × 6 4 × 8 3 ? S2 – Chapter 2 – Binomial Distribution Lesson 2: Binomial Distribution Back in 2010 I was on holiday in Hawaii and visited the family of a friend. We noticed that at the dinner table that out of the 8 of us, 6 of us were left-handed (including myself). One of them asked, “The chances of that must be very low”. I saw that as a challenge. Consider the 8 people in a line. Suppose 10% of the population is left-handed. Can you now work out the probability of 6 being left-handed now? One possibility say is LLRLLRLL. The probability of this particular possibility is 𝟎. 𝟏 × 𝟎. 𝟏 × 𝟎. 𝟗 × 𝟎. 𝟏 × ⋯ = 𝟎. 𝟏𝟔 × 𝟎. 𝟗𝟐 𝟖 = 𝟐𝟖 possible ways in which 6 𝟔 people in the room could be left handed. But there are So probability is 𝟏 𝒊𝒏 𝟒𝟒 𝟎𝟎𝟎 ? 𝟖 × 𝟎. 𝟏𝟔 × 𝟎. 𝟗𝟐 = 𝟎. 𝟎𝟎𝟎𝟐𝟐𝟔𝟖 ≈ 𝟔 Test Your Understanding Q I throw a unfair coin 10 times, where the probability of heads is 𝑝. What’s the probability of throwing 3 heads? Let 𝑋 be a random variable which counts the number of heads seen in 10 throws. Determine the probability distribution. For convenience you can use 𝑞 as the probability of tails (where 𝑞 = 1 − 𝑝) 𝒙 𝟎 𝟏 𝑃 𝑋=𝑥 𝑞10 10 𝑝𝑞 9 1 ? ? 𝟐 10 2 8 𝑝 𝑞 2 ? 𝟑 10 3 7 𝑝 𝑞 3 ? 𝟒 10 4 6 𝑝 𝑞 4 ? 𝟓 10 5 5 𝑝 𝑞 5 ? 𝟔 10 6 4 𝑝 𝑞 6 ? 𝟕 10 7 3 𝑝 𝑞 7 ? 𝟖 10 8 2 𝑝 𝑞 8 ? 𝟗 10 9 1 𝑝 𝑞 9 Notice that each of the terms form the Binomial Expansion of 𝑝 + 𝑞 10 (as per C2). Since 𝑝 + 𝑞 = 1, 𝑝 + 𝑞 10 = 1, which shows that the probabilities add to 1 (as we’d hope!) For this reason we call this type of distribution a Binomial Distribution. ? 𝟏𝟎 𝑝10 ? Binomial Distribution ! e.g. We threw a coin 𝑛 times. We have a Binomial Distribution when we have: 1. 2. 3. 4. a FIXED number 𝑛 trials. The trials are INDEPENDENT. A CONSTANT probability 𝑝 of success (in each trial) TWO outcomes in each trial, “success” and “failure”. So that we’re allowed to multiply the probabilities together from each trial We’re counting heads, so throwing a heads is the “success”. If these conditions are met, a random variable 𝑋 whose outcome is the number of successes is Binomially distributed: 𝑋~𝐵 𝑛, 𝑝 𝑃 𝑋=𝑥 = 𝑥 is number of successes. 𝑛 𝑥 𝑝 1−𝑝 𝑥 𝑛−𝑥 If 𝑛 trials and 𝑥 successes, must be 𝑛 − 𝑥 failures. FICT Quickfire Questions Show the calculation required to find the indicated probability given the distribution. 𝑋~𝐵 10,0.3 𝟏𝟎 𝑷 𝑿=𝟒 = 𝟎. 𝟑𝟒? 𝟎. 𝟕𝟔 𝟒 𝑋~𝐵 10,0.2 𝟏𝟎 𝑷 𝑿=𝟑 = 𝟎. 𝟐𝟑? 𝟎. 𝟖𝟕 𝟑 𝑋~𝐵 5,0.1 𝟓 𝑷 𝑿=𝟐 = 𝟎. 𝟏𝟐 ?𝟎. 𝟗𝟑 𝟐 𝑋~𝐵 20,0.45 𝑷 𝑿 = 𝟐𝟎 = 𝟎. 𝟒𝟓𝟐𝟎 ? 𝑋~𝐵 20,0.45 𝑷 𝑿 = 𝟎 = 𝟎. 𝟓𝟓𝟐𝟎 ? Is it Binomially Distributed? Is a Binomial Distribution appropriate as a model? Some number out of 8 people being left-handed 1. We have a fixed number 𝑛 trials. 2. Each trial has two possibilities, “success” and “failure”. 3. The trials are independent. 4. There is a fixed probability 𝑝 of success in each trial. The number of red balls selected when 3 balls are drawn from bag of 15 white and 5 red balls. Number of throws on die until 6 obtained Number of girls in family of 4 children No, not fixed. This is known as a ‘Geometric Distribution’ (which we won’t cover) ? ? ? Usually. But in my story, genetics has an influence on handedness. Technically the probability of having a girl increases if you previously had a girl, and vice versa. But the probability is still close to 0.5, so Binomial Distribution is appropriate. ? Only if balls drawn with replacement. Only if balls drawn with replacement, 1 𝑝= 4 Test Your Understanding Q1 1 𝑋~𝐵 12, 6 What is 𝑃(𝑋 = 2)? 𝑷 𝑿=𝟐 = 𝟏𝟐 𝟐 ?𝟏𝟔 𝟐 𝟓 𝟔 𝟏𝟎 = 𝟎. 𝟐𝟗𝟔 What is 𝑃(𝑋 ≤ 1)? 𝑷 𝑿≤𝟏 =𝑷 𝑿=𝟎 +𝑷 𝑿=𝟏 𝟏𝟐 𝟏 𝟓 𝟏 𝟓 𝟏𝟐 = +? 𝟏 𝟔 𝟔 𝟔 = 𝟎. 𝟑𝟖𝟏 Q2 a b 𝟏𝟏 I have a bag of 2 red and 8 white balls. 𝑋 represents the number of red balls I chose after 5 selections (with replacement). How is 𝑋 distributed? 𝑿~𝑩 ?𝟓, 𝟎. 𝟐 Determine the probability that I chose 3 red balls. 𝟓 𝑷 𝑿=𝟑 = 𝟎.? 𝟐𝟑 𝟎. 𝟖𝟐 = 𝟎. 𝟎𝟓𝟏𝟐 𝟑 (If you get these quickly, go on to Exercise 1B) Exercise 1B 1 3 4 1 The random variable 𝑋~𝐵 8, 3 Find 𝑃 𝑋 = 2 = 𝟎. 𝟐𝟕𝟑 𝑃 𝑋 = 5 = 𝟎. 𝟎𝟔𝟖𝟑 ? 𝑃 𝑋 ≤ 1 = 𝟎. 𝟏𝟗𝟓 5 a 2 The random variable 𝑇~𝐵 15, 3 Find ? 𝑃 𝑇 = 5 = 𝟎. 𝟎𝟎𝟔𝟕𝟎 𝑃 𝑇 = 10 = 𝟎. 𝟐𝟏𝟒 ? 𝑃 3 ≤ 𝑇 ≤ 4 = 𝟎. 𝟎𝟎𝟏𝟕𝟖 ? A balloon manufacturer claims that 95% of his balloons will not burst when blown up. You have 20 balloons. What is the probability that none of them burst? 𝟎. 𝟗𝟓𝟐𝟎 = 𝟎.? 𝟑𝟓𝟖 𝒕𝒐 𝟑𝒔𝒇 What is the probability exactly 2 burst? = 𝟎. 𝟏𝟖𝟗 ? A student suggests using a binomial distribution to model the following situations. Give a description of the random variable, state any assumptions that must be made and give possible values for 𝑛 and 𝑝. A sample of 20 bolts is checked for defects from a large batch. The production process should produce 1% of defective bolts. 𝑿~𝑩 𝟐𝟎, 𝟎. 𝟎𝟏 assuming bolts being defective are independent from each other. ? b Some traffic lights have three phases: stop 48% of the time, wait or get ready 4% of the time and go 48% of the time. Assuming that you only cross a traffic light when it is in the go position, model the number of times that you have to wait or stop on a journey passing through 6 sets of traffic lights. 𝑿~𝑩 𝟔, 𝟎. 𝟓𝟐 assuming lights operate independently. ? c When Stephanie plays tennis with Tim on average one in eight of her serves is an ‘ace’. How many ‘aces’ does Stephanie serve in the next 30 serves against Tim? 𝟏 𝑿~𝑩 𝟑𝟎, assuming serves are independent 𝟖 and probability of an ace is constant. ? Overview So Far These are all based on the parameters we set. Description Name Params We count the number of ‘successes’ after a number of trials, each with two outcomes (‘success’ and ‘failure’). e.g. Number of heads after 10 throws of an unfair coin. Binomial Distribution 𝑩 𝒏, 𝒑 Number of trials 𝑛 Probability of success in each trial 𝑝 ? Outcomes 0, 1, … , 𝑛 ? Prob Func 𝑝 𝑥 = 𝑛 𝑥 𝑝 1−𝑝 𝑥 𝑛−𝑥 ? Still to cover: • The Cumulative Distribution Function 𝐹(𝑥) • Calculating 𝐸 𝑋 and 𝑉𝑎𝑟 𝑋 𝑬𝑿 𝑽𝒂𝒓 𝑿 ? ? S2 – Chapter 2 – Binomial Distribution Lesson 3: Cumulative Distribution Function Cumulative Distribution Function In S1, the Cumulative Distribution Function is defined as: 𝑭 𝒙 = 𝑷 𝑿? ≤𝒙 and means: “the probability of the outcome ? being up to a particular value”. We saw in S1 that for the Normal Distribution, we had to look up 𝐹 𝑥 values in a z-table, because they were not possible to calculate with a simple formula. There’s a similar problem here: To calculate 𝐹 10 = 𝑃 𝑋 = 1 + 𝑃 𝑋 = 2 + ⋯ + 𝑃 𝑋 = 10 would be computationally expensive, as the summation doesn’t simplify and the factorial function is an expensive operation (your calculator takes roughly half a second to compute 50!). We therefore use tables (From Page 135 in the newer S2 Edexcel textbooks). The random variable 𝑋~𝐵(20,0.4). Find: 𝑃 𝑋 ≤ 7 = 0.4159 ? 𝑃 𝑋 < 6 = 𝑃 𝑋 ≤ 5 ?= 0.1256 𝑃 𝑋 ≥ 15 = 1 − 𝑃 𝑋 ≤ 14 ? = 0.0016 Look up 𝑛 = 20, 𝑝 = 0.4, 𝑥 = 7 Cumulative Distribution Function We can also use the table to find when 𝑋 = 𝑥 or 𝑎 ≤ 𝑋 ≤ 𝑏. Given that 𝑋~𝐵 25,0.25 𝑃 𝑋 =6 =𝑷 𝑿≤𝟔 −𝑷 𝑿≤𝟓 ? = 𝟎. 𝟏𝟖𝟐𝟖 𝑃 𝑋 > 20 = 𝟏 − 𝑷 𝑿?≤ 𝟐𝟎 𝑃 6 < 𝑋 ≤ 10 = 𝑷 𝑿 ≤ 𝟏𝟎 ?− 𝑷(𝑿 ≤ 𝟔) But you would never need to do this in an exam – even for the biggest value of 𝑛 in the table, your calculator could calculate this directly! Be careful about < vs ≤ Quickfire Questions Write the following in terms of cumulative probabilities, e.g. 𝑃 𝑋 < 7 = 𝑃 𝑋 ≤ 6 𝑃 𝑃 𝑃 𝑃 𝑋 < 5 = 𝑷 𝑿? ≤𝟒 𝑋 ≥ 7 = 𝟏 − 𝑷 ?𝑿 ≤ 𝟔 𝑋 > 7 = 𝟏 − 𝑷 ?𝑿 ≤ 𝟕 10 ≤ 𝑋 < 20 = 𝑷 𝑿 ≤ 𝟏𝟗 ?− 𝑷 𝑿 ≤ 𝟗 ? ? ? ? ? 𝑃 10 ≤ 𝑋 ≤ 20 = 𝑷 𝑿 ≤ 𝟐𝟎 − 𝑷 𝑿 ≤ 𝟗 𝑃 𝑋 = 100 = 𝑷 𝑿 ≤ 𝟏𝟎𝟎 − 𝑷 𝑿 ≤ 𝟗𝟗 𝑃 20 < 𝑋 < 30 = 𝑷 𝑿 ≤ 𝟐𝟗 − 𝑷 𝑿 ≤ 𝟐𝟎 “at least 30” = 𝑷 𝑿 ≥ 𝟑𝟎 = 𝟏 − 𝑷 𝑿 ≤ 𝟐𝟗 “greater than 30” = 𝑷 𝑿 > 𝟑𝟎 = 𝟏 − 𝑷 𝑿 ≤ 𝟑𝟎 Test Your Understanding An awkward Tiffin boy ventures into Tiffin Girls. He asks 20 girls out on the date. The probability that each girl says yes is 0.3. Determine the probability that he will end up with: a) Less than 6 girls on his next date. b) At least 9 girls on his next date. Q The boy considers the evening a success if he dated at least 9 girls that evening. He repeats this process across 5 evenings. c) Calculate the probability that he had at least 4 successful evenings. (Note: You won’t be able to use your table for (c) as 𝑝 is not a nice round number – calculate prob directly) a b c 𝑋~𝐵 20, 0.3 𝑋 is the number of girls dated in an evening. 𝑃 𝑋<6 =𝑃 𝑋≤5 ? = 𝟎. 𝟒𝟏𝟔𝟒 𝑃 𝑋 ≥9 =1−𝑃 𝑋 ≤8 = 𝟏 − 𝟎. 𝟖𝟖𝟔𝟕 ? = 𝟎. 𝟏𝟏𝟑𝟑 𝑌~𝐵 5, 0.1133 𝑌 is the number of successful evenings. 𝑷 𝑿≥𝟒 =𝑷 𝑿=𝟒 +𝑷 𝑿=𝟓 𝟓 ? 𝟎. 𝟏𝟏𝟑𝟑𝟓 = 𝟎. 𝟏𝟏𝟑𝟑𝟒 × 𝟎. 𝟖𝟖𝟔𝟕 + 𝟒 = 𝟎. 𝟎𝟎𝟎𝟕𝟒𝟗 Exercise 1C 1 𝑋~𝐵 9, 0.2 𝑃 𝑋 ≤ 4 = 𝟎. 𝟗𝟖𝟎𝟒 𝑃 𝑋 < 3 = 𝟎. 𝟕𝟑𝟖𝟐 𝑃 𝑋 ≥ 2 = 𝟎. 𝟓𝟔𝟑𝟖 𝑃 𝑋 = 1 = 𝟎. 𝟑𝟎𝟐𝟎 8 ? ? 3 a b In a town, 30% of the residents listen to the local radio. Ten residents are chosen at random. State the distribution for the random variable. 𝑿~𝑩(𝟏𝟎, 𝟎. 𝟑𝟎) Find the probability that at least half of these 10 residents listen to local radio. 𝟎. 𝟏𝟓𝟎𝟑 ? ? 𝑋~𝐵(40,0.45). Find 𝑃 𝑋 < 20 = 𝟎. 𝟔𝟖𝟒𝟒 𝑃 𝑋 > 16 = 𝟎. 𝟔𝟖𝟏𝟓 𝑃 11 ≤ 𝑋 ≤ 15 = 𝟎. 𝟐𝟎𝟔𝟖 𝑃 10 < 𝑋 < 17 = 𝟎. 𝟑𝟏𝟏𝟏 ? Further Question (not in book) ? a Light bulbs come in packs of 6. The probability of any given lightbulb being faulty is 0.05. What’s the probability that more than 3 bulbs are faulty. 𝑿~𝑩 𝟔, 𝟎. 𝟎𝟓 𝑷 𝑿>𝟑 =𝟏−𝑷 𝑿≤𝟑 = 𝟎. 𝟎𝟎𝟎𝟏 A pack can only be sold if it contains no faulty bulbs. Calculate the probability that out of 10 packs, exactly 8 can be sold. 𝑷 𝑿 = 𝟎 = 𝟎. 𝟗𝟓𝟔 = 𝟎. 𝟕𝟑𝟓𝟏 𝒀~𝑩 𝟏𝟎, 𝟎. 𝟕𝟑𝟓𝟏 𝒀 is number of non-faulty packs. 𝟏𝟎 𝑷 𝒀=𝟖 = 𝟎. 𝟕𝟑𝟓𝟏𝟖 𝟎. 𝟐𝟔𝟒𝟗𝟐 = 𝟎. 𝟐𝟔𝟗𝟐 𝟖 ? b ? You can start on your homework questions if you’ve done all of these (ask for sheet). S2 – Chapter 2 – Binomial Distribution Lesson 4: Probability Ranges Dealing with Probability Ranges Q A spinner is designed so that probability it lands on red is 0.3. Jane has 12 spins. a) Find the probability that Jane obtains at least 5 reds. Jane decides to use this spinner for a class competition. She wants the probability of winning a prize to be < 0.05. Each member of the class will have 12 spins and the number of reds will be recorded. b) Find how many reds are needed to win the prize. 𝑃 𝑋 ≥ 5 = 1 − 𝑃 𝑋 ≤ 4 = 0.2763 𝑃 𝑋 ≥ 𝑟 < 0.05 1 − 𝑃 𝑋 ≤ 𝑟 − 1 < 0.05 𝑃 𝑋 ≤ 𝑟 − 1 > 0.95 𝑟−1=6 𝒓=𝟕 STEP 1: Represent the sentence using probability. STEP 2: Ensure LHS involves ≤ inside probability. ? STEP 3: Rearrange. STEP 4: Use table backwards to find value corresponding to closest probability. Note that the textbook does this in a less methodical way: but the method above is what you find in exam mark schemes, so ignore at your peril. Test Your Understanding Q At Camford University, students have 20 exams at the end of the year. All students pass each individual exam with probability 0.45. Students are only allowed to continue into the next year if they pass some minimum of exams out of the 20. What do the university administrators set this minimum number such that the probability of continuing to next year is at least 90%? 𝑋~𝐵 20, 0.45 𝑃 𝑋 ≥ 𝑘 ≥ 0.9 1 − 𝑃 𝑋 ≤ 𝑘 − 1 ≥ 0.9 𝑃 𝑋 ≤ 𝑘 − 1 ≤ 0.1 𝑘−1=5 ? 𝒌=𝟔 This is exactly what you should write. Exercise 1C (again) 7 𝑋~𝐵 50,0.40 . Find The largest value of 𝑘 such that 𝑃 𝑋 ≤ 𝑘 < 0.05 𝒌 = 𝟏𝟑 The smallest number 𝑟 such that 𝑃 𝑋 > 𝑟 < 0.01 𝒓 = 𝟐𝟖 ? ? 8 𝑋~𝐵 50,0.10 . Find The largest value of 𝑘 such that 𝑃 𝑋 < 𝑘 < 0.02 𝒌=𝟏 The smallest number 𝑟 such that 𝑃 𝑋 > 𝑟 < 0.01 𝒓 = 𝟏𝟎 𝑃 𝑘≤𝑋≤𝑟 𝟎. 𝟗𝟖𝟎𝟏 ? ? ? Further Questions (not in book) A 𝑋~𝐵 25, 0.2 Find the smallest value of 𝑘 such that 𝑃 𝑋 ≥ 𝑘 < 0.05 𝑷 𝑿 ≤ 𝒌 − 𝟏 > 𝟎. 𝟗𝟓 𝒌−𝟏=𝟖 → 𝒌=𝟗 ? B Each question in a test has a 50% chance of being answered correctly. What minimum pass mark out of 10 is required such that at least 75% of students will pass? 𝑿~𝑩 𝟏𝟎, 𝟎. 𝟓 𝑷 𝑿 ≥ 𝒌 ≥ 𝟎. 𝟕𝟓 𝑷 𝑿 ≤ 𝒌 − 𝟏 ≤ 𝟎. 𝟐𝟓 𝒌 − 𝟏 = 𝟑? 𝒌=𝟒 S2 – Chapter 2 – Binomial Distribution Lesson 5: E[X], Var[X], and tables with 𝑝 > 0.5 Mean 𝐸 𝑋 and Variance 𝑉𝑎𝑟 𝑋 I want to know amongst 200 people the probability of a certain number being left handed, where the probability any given person is left handed is 0.1. 𝑋~𝐵 200, 0.1 gives a binomial distribution over the possible numbers of lefthanded people. Based on what you learnt in Year 8/9, how many people would you expect on average to be left-handed? 𝟐𝟎𝟎 × 𝟎. 𝟏 = 𝟐𝟎 i.e. We multiplied the number of trials 𝒏 and the probability of success 𝒑 to ? work out the mean number of successes. The variance is much harder to work out and we won’t give the proof here. !If 𝑋~𝐵 𝑛, 𝑝 𝐸 𝑋 = 𝜇 = 𝑛𝑝 𝑉𝑎𝑟 𝑋 = 𝜎 2 = 𝑛𝑝 1 − 𝑝 Bro Tip: It’s perhaps easier to remember variance as 𝑛𝑝𝑞 (where 𝑞 = 1 − 𝑝 is the probability of failure, although these are given the formula book) Examples A fair, 4-sided die has the numbers 1, 2, 3, 4 on its faces. The die is rolled 20 times. The random variable 𝑋 represents the number of 4s obtained. Find the mean and variance of 𝑋. 𝑿~𝑩 𝟐𝟎, 𝟎. 𝟐𝟓 Q 𝑬 𝑿 = 𝟐𝟎 × 𝟎. 𝟐𝟓 = 𝟓 𝑽𝒂𝒓 𝑿 = 𝟐𝟎 × 𝟎. 𝟐𝟓 × 𝟎. 𝟕𝟓 = 𝟑. 𝟕𝟓 Find 𝑃 𝑋 < 𝜇 − 𝜎 𝝈 = 𝟑. 𝟕𝟓 = 𝟏. 𝟗𝟑𝟔 … 𝑷 𝑿 < 𝝁 − 𝝈 = 𝑷 𝑿 < 𝟑. 𝟎𝟔. . = 𝑷 𝑿 ≤ 𝟑 = 𝟎. 𝟐𝟐𝟓𝟐 ? ? David believes that 35% of people in a certain town will vote for him in the next election and he commissions a survey. Find the minimum number of people the survey should ask to have a Q mean number of more than 100 voting for David. 𝟎. 𝟑𝟓𝒏 = 𝟏𝟎𝟎 𝒏 = 𝟐𝟖𝟓. 𝟕 So 𝟐𝟖𝟔 people should be asked. ? An examiner is trying to design a multiple choice test. For students answering the test at random, he requires that the mean score on the test should be 20 and standard deviation at least 4. Find how many choices each question should have and the number of questions there should be. Number of choices is fixed across questions and show be as small as possible. Q 𝒏𝒑 = 𝟐𝟎 𝒏𝒑 𝟏 − 𝒑 ≥ 𝟒 → 𝟐𝟎 𝟏 − 𝒑 ≥ 𝟒 → 𝒑 ≤ 𝟎. 𝟐 So there should be 5 choices per question. 𝒏𝒑 = 𝟐𝟎 → 𝟎. 𝟐𝒏 = 𝟐𝟎 → 𝒏 = 𝟏𝟎𝟎 ? Exercise 1D Using tables when 𝑝 > 0.5 Just as the z-table for the Normal Distribution only had probabilities greater than 0.5, the Cumulative Distribution Function tables only have values for 𝑝 less than 0.5! We similarly have to do some manipulation when 𝑝 > 0.5. In Joe’s café 70% of customers buy a cup of tea. a) In a random sample of 20 customers find the probability that more than 15 buy a cup of tea. Let 𝑿 = the number out of 20 who buy a cup of tea. 𝑿~𝑩 𝟐𝟎, 𝟎. 𝟕 Let 𝒀 = the number of customers who do not buy a cup of tea. Hint: Perhaps rethink the problem in terms of who doesn’t buy tea. 𝒀~𝑩 𝟐𝟎, 𝟎. 𝟑 𝑷 𝑿 > 𝟏𝟓 = 𝑷 𝒀 ≤ 𝟒 = 𝟎. 𝟐𝟑𝟕𝟓 ? Notes: By focusing on the opposite, we can get our 𝑝 to be above 0.5. If more than 15 people buy tea, at most 4 didn’t drink tea. So we can instead find the probability of this. Bro Tip: In general, if 𝑋 < 𝑎, then 𝑌 > 𝑛 − 𝑎 And if 𝑋 ≤ 𝑎, then 𝑌 ≥ 𝑛 − 𝑎 So we just subtract from the number of trials and preserve the strictness/non-strictness of the inequality. Quickfire Questions Change from the count of successes 𝑋 to the count of failures 𝑌, ensuring you ends up with ≤. Given 100 trials: ≥ 60 = 𝑷 𝒀 ≤? 𝟒𝟎 < 30 = 𝑃 𝑌 > 70 = 𝟏? − 𝑷 𝒀 ≤ 𝟕𝟎 > 20 = 𝑃 𝑌 < 80 =? 𝑷 𝒀 ≤ 𝟕𝟗 ≥ 30 = 𝑷 𝒀 ≤ 𝟕𝟎 ? ≤ 25 = 𝑃 𝑌 ≥ 75 = 𝟏? − 𝑷 𝒀 ≤ 𝟕𝟒 < 30 ≤ 0.2 → 𝑷 𝒀 > 𝟕𝟎 ≤ 𝟎. 𝟐 ? 𝟖 𝑷 𝒀 ≤ 𝟕𝟎 ≥ 𝟎. 𝑃 𝑋 ≤ 65 ≥ 0.55 → 𝑷 𝒀 ≥ 𝟑𝟓 ≥ 𝟎. 𝟓𝟓 𝑷 𝒀 ≤ 𝟑𝟒 ≤ ?𝟎. 𝟒𝟓 𝑃 𝑃 𝑃 𝑃 𝑃 𝑃 𝑋 𝑋 𝑋 𝑋 𝑋 𝑋 Test Your Understanding Historically, 75% of people who have visited KGS have been eaten by bears. If 30 Tiffin Boys visit KGS, determine the probability that at least 20 of them will be eaten by bears. Let 𝑿 be number of boys eaten by bears, and 𝒀 number who don’t. 𝑿~𝑩 𝟑𝟎, 𝟎. 𝟕𝟓 𝒀~𝑩(𝟑𝟎, 𝟎. 𝟐𝟓) 𝑷 𝑿 ≥ 𝟐𝟎 = 𝑷 𝒀 ≤ 𝟏𝟎 = 𝟎. 𝟖𝟗𝟒𝟑 ? S2 May 2012 Q8 (Part (b) was very challenging according to the Examiner’s Report!) Note: they’re sneakily trying to confuse you here because 𝑛 here is not the number of trials! 𝑋~𝐵 50,0.6 𝑌~𝐵 50,0.4 𝑃 𝑋 < 𝑛 = 𝑃 𝑌 > 50 − 𝑛 ≥ 0.9 𝑃 𝑌 ≤ 50 − 𝑛 ≤ 0.1 50 − 𝑛 ≤ 15 𝑛 ≥ 35 𝑛 = 35 ? And more general probability questions… In Joe’s café 70% of customers buy a cup of tea. a) In a random sample of 20 customers find the probability that more than 15 buy a cup of tea. Let 𝑿 = the number out of 20 who buy a cup of tea. 𝑿~𝑩 𝟐𝟎, 𝟎. 𝟕 Let 𝒀 = the number of customers who do not buy a cup of tea. 𝒀~𝑩 𝟐𝟎, 𝟎. 𝟑 𝑷 𝑿 > 𝟏𝟓 = 𝑷 𝒀 ≤ 𝟒 = 𝟎. 𝟐𝟑𝟕𝟓 b) The proportion of customers who buy a chocolate muffin at Joe’s café is 0.35. Find the probability that Joe sells the first chocolate muffin to his fifth customer. The first four customers don’t buy a muffin, and the fifth does. 𝟎. 𝟔𝟓𝟒 × 𝟎. 𝟑𝟓 = 𝟎. 𝟎𝟔𝟐𝟓 (𝒕𝒐 𝟑𝒔𝒇) ? c) Find the probability that in a random sample of 20 customers more than 15 buy a cup of tea and a least 6 buy a chocolate muffin. 𝑷 𝑴≥𝟔 =𝟏−𝑷 𝑴≤𝟓 = 𝟎. 𝟕𝟓𝟒𝟔 𝑷 𝑴 ≥ 𝟔 𝒂𝒏𝒅 𝑿 > 𝟏𝟓 = 𝟎. 𝟕𝟓𝟒𝟔 × 𝟎. 𝟐𝟑𝟕𝟓 = 𝟎. 𝟏𝟕𝟗 (𝟑 𝒔𝒇) ? Exercises 1 Cats in general eat 65% of mice that they encounter. 4 Calculate the probability that for 10 mice Pippin encounters in the next hour, she eats at least 6. a 𝑿~𝑩 𝟏𝟎, 𝟎. 𝟔𝟓 𝒀~𝑩 𝟏𝟎, 𝟎. 𝟑𝟓 𝑷 𝑿 ≥ 𝟔 = 𝑷 𝒀 ≤ 𝟒 = 𝟎. 𝟕𝟓𝟏𝟓 ? 𝑿~𝑩 𝟐𝟎, 𝟎. 𝟕 𝒀~𝑩 𝟐𝟎, 𝟎. 𝟑 𝑷 𝑿 ≥ 𝒌 ≥ 𝟎. 𝟗𝟓 𝑷 𝒀 ≤ 𝟐𝟎 − 𝒌 ≥ 𝟎. 𝟗𝟓 𝟐𝟎 − 𝒌 = 𝟗 𝒌 = 𝟏𝟏 2 There is 80% chance that Pippin the cat wakes me up before 5.30am for food. Over the next week (7 days), what is the probability she wakes me up for less than 4 of them? 𝑿~𝑩 𝟕, 𝟎. 𝟖 𝒀~𝑩 𝟕, 𝟎. 𝟐 𝑷 𝑿<𝟒 =𝑷 𝒀>𝟑 =𝟏−𝑷 𝒀≤𝟑 = 𝟎. 𝟎𝟑𝟑𝟑 ? 3 In my cupboard I have 3 boxes of Whiskers, 6 boxes of Felix and 1 box of Waitrose Essentials Dry Food Mix, each box with a plentiful supply of meals. Over 15 meals, what’s the probability Pippin eats Felix at most 5 times? 𝑿~𝑩 𝟏𝟓, 𝟎. 𝟔 𝒀~𝑩 𝟏𝟓, 𝟎. 𝟒 𝑷 𝑿 ≤ 𝟓 = 𝑷 𝒀 ≥ 𝟏𝟎 = 𝟏−𝑷 𝒀≤𝟗 = 𝟎. 𝟎𝟑𝟑𝟖 ? The probability Pippin gets a stroke on any given day is 0.7. What is the minimum number of days she must be stroked over the next 20 so that there is at least a 95% chance I stroke her at least this number of times? ? b What is the probability that her first stroke isn’t until the 5th day? 𝟎. 𝟑𝟒 × 𝟎. 𝟕 = 𝟎. 𝟎𝟎𝟓𝟔𝟕 ? 5 90% of cats are black. Pippin has 50 kittens. Forgetting genetics and that Pippin is neutered, what’s the most number of kittens such that I am at least 55% sure less than this number will be black. 𝑿~𝑩 𝟓𝟎, 𝟎. 𝟗 𝒀~𝑩(𝟓𝟎 𝟎. 𝟏) 𝑷 𝑿 < 𝒌 ≥ 𝟎. 𝟓𝟓 𝑷 𝒀 > 𝟓𝟎 − 𝒌 ≥ 𝟎. 𝟓𝟓 𝑷 𝒀 ≤ 𝟓𝟎 − 𝒌 ≤ 𝟎. 𝟒𝟓 𝟓𝟎 − 𝒌 = 𝟒 → 𝒌 = 𝟒𝟔 ? 𝑛 or 𝑝 is unknown The previous question was to establish an unknown 𝑥. But if the parameter 𝑛 or 𝑝 is unknown, we just have to use mathematical common sense (see part c). S2 May 2013 Q7 𝑿~𝑩 𝒏, ? 𝟎. 𝟏 𝒀~𝑩 𝟏𝟎, 𝟎. 𝟏 𝑷 𝒀≥𝟒 =𝟏−𝑷 𝒀≤𝟑 = 𝟎. 𝟎𝟏𝟐𝟖 ? 𝑷 𝒀≥𝟏 =𝟏−𝑷 𝒀=𝟎 𝟏 − 𝟎. 𝟗𝒏 > 𝟎. 𝟗𝟓 𝟎. 𝟗𝒏 < 𝟎. 𝟎𝟓 𝒏 > 𝟐𝟖. 𝟒 𝒏 ≥ 𝟐𝟗 ? You won’t be able to do (d) until Chapter 2. 𝑛 or 𝑝 is unknown S2 Jan 2013 Q3 𝑃 𝑋 = 0 = 1 − 𝑝 12 = 0.05 12 1 − 𝑝 = 0.05 = 0.779 𝑝 = 0.221 ? Exercise 1C Further Exercises (not in textbook) 1 I play a game 10 times with a 𝑝 probability of winning. Given that the probability I win every time is 10%, determine 𝑝. 𝒑𝟏𝟎 = 𝟎. 𝟏 𝒑 = 𝟎. 𝟕𝟗𝟒 I play a different game 10 times with a 𝑞 probability of winning. Given that 𝑃 𝑋 = 0 = 0.1, where 𝑋 is the number of times I win, determine 𝑞 𝒒 = 𝟎. 𝟐𝟎𝟔 If a third game has a 40% chance of winning, how many times will I have to play it to have at least a 99% chance of winning more than once. 𝑷 𝑿 ≥ 𝟏 = 𝟏 − 𝟎. 𝟔𝒏 = 𝟎. 𝟗𝟗 𝒏 ≥ 𝟗. 𝟎𝟏𝟓 𝒏 = 𝟏𝟎 ? 2 3 ? ? Summary We use a Binomial distribution when we want the probability of some number of ‘successes’ out of 𝑛 independent trials, in which each trial has only two outcomes. These are all based on the parameters we set. Description Name Params We count the number of ‘successes’ after a number of trials, each with two outcomes (‘success’ and ‘failure’). e.g. Number of heads after 10 throws of an unfair coin. Binomial Distribution 𝑩 𝒏, 𝒑 Number of trials 𝑛 Probability of success in each trial 𝑝 ? Outcomes 0, 1, … , 𝑛 ? Prob Func 𝑝 𝑥 = 𝑛 𝑥 𝑝 1−𝑝 𝑥 ? 𝑥 𝑬𝑿 𝑽𝒂𝒓 𝑿 𝑛𝑝 𝑛𝑝 1 − 𝑝 ? ? We can use tables to calculate 𝑃 𝑋 ≤ 𝑥 . However, if 𝑝 > 0.5 we have to instead count the number of failures.