advertisement

S2 Chapter 2: Poisson Distribution Dr J Frost (jfrost@tiffin.kingston.sch.uk) www.drfrostmaths.com Last modified: 20th September 2015 What is the Poisson Distribution? Name Description Outcomes Binomial 𝐵(𝑛, 𝑝) The number of “successes” out of 𝑛 ? a trials, each with probability 𝑝 of success. Number of successes {0, 1, 2, … , 𝑛} Poisson 𝑃𝑜(𝜆) How many events occur within some period of time, given an ? average rate 𝜆 (“lambda”) at which they occur. Number of events ℕ = {0, 1, 2, … } ? (since technically any nonnegative number of events occur) ? How does it arise? (You don’t need to write any of this down) We said that the Poisson Distribution allows us to calculate the count of a number of events happening within some period, given an average rate. Calculate the probability of 8 cars passing in the next hour, given that on average 5 pass an hour. Q Suppose we wanted to see how we could do this with a Binomial Distribution… 3pm 2pm Suppose we divided the hour up into 10 equal time intervals. Each time slot is a trial, where “success” is a car passing in that period. Now if we expect 5 cars on average in the hour (i.e. 𝜆 = 5), and we’ve made 10 time slots (i.e. 𝑛 = 10), what is the probability of success, i.e. that a car passes in a given time interval? 𝝀 𝟓 𝒑 = =? 𝒏 𝟏𝟎 Then to answer the original question: 𝑿~𝑩 𝟏𝟎, 𝟎. 𝟓 𝑷 𝑿 = 𝟖? = 𝟏𝟎 𝟎. 𝟓𝟖 𝟎. 𝟓𝟐 = 𝟎. 𝟎𝟒𝟑𝟗 𝟖 How does it arise? 3pm 2pm 𝑃 𝑋 = 8 = 0.0439 A problem with how we’ve modelled this is that more the one car could pass in any given time interval, and thus the count of successes won’t necessarily be the count of cars. How could we lessen this problem? 2pm 3pm We can split into shorter time intervals! If there’s now 20 intervals (and still an average rate of 5 cars an hour), calculate the probability of 8 cars passing now: 𝝀 𝟓 𝒑= = = 𝟎. 𝟐𝟓 𝑿~𝑩 𝟐𝟎, 𝟎. 𝟐𝟓 𝒏 𝟐𝟎 ? 𝟐𝟎 𝑷 𝑿=𝟖 = 𝟎. 𝟐𝟓𝟖 𝟎. 𝟕𝟓𝟏𝟐 = 𝟎. 𝟎𝟔𝟎𝟗 𝟖 How does it arise? We can gradually increase the number 𝒏 of time intervals we’ve split the hour interval into, until we get infinitely small slivers of time, where only one event can occur in any time sliver, and thus it is acceptable to have “success” and “failure”, where the count of successes will now indeed be the count of cars. 𝑃 𝑋 = 𝑥 = lim 𝑛→∞ 𝑒 −𝜆 𝜆𝑥 = 𝑥! 𝑛 𝑥 𝑝 1−𝑝 𝑥 𝑛−𝑥 ? 𝑤ℎ𝑒𝑟𝑒 𝑝 = 𝜆 𝑛 The proof of this is quite complicated! ! The Poisson Distribution is a distribution over the number of events which occur within a period of time, given an average rate 𝜆. 𝑒 −𝜆 𝜆𝑥 𝑃 𝑋=𝑥 = 𝑥! Examples Q 𝑋~𝑃𝑜(1.2), find 𝒆−𝟏.𝟐 ×𝟏.𝟐𝟑 𝟑! a) 𝑃 𝑋 = 3 = =?𝟎. 𝟎𝟖𝟔𝟕 b) 𝑃 𝑋 ≥ 1 = 𝟏 − 𝑷 𝟎 ? = 𝟏 − 𝒆−𝟏.𝟐 = 𝟎. 𝟔𝟗𝟗 c) 𝑃 3 < 𝑋 ≤ 5 = 𝑷 𝑿 = 𝟒 + 𝑷 𝑿 = 𝟓 𝒆−𝟏.𝟐 × 𝟏. 𝟐𝟒 𝒆−𝟏.𝟐 × 𝟏. 𝟐𝟓 = + 𝟒! ? 𝟓! Q Given that www.drfrostmaths.com receives 25 hits an hour on average, determine the probability it receives 20 hits in the next hour. 𝑿~𝑷𝒐 𝟐𝟓 𝒆−𝟐𝟓 × 𝟐𝟓𝟐𝟎 ? 𝑷 𝑿 = 𝟐𝟎 = = 𝟎. 𝟎𝟓𝟏𝟗 𝟐𝟎! Exercise 2A 1 Given 𝑋~𝑃𝑜 2.3 find 3 Given 𝑌~𝑃𝑜 0.35 find 4 a) 𝑃 𝑋 = 4 = 𝟎. 𝟏𝟏𝟕 a) 𝑃 𝑌 = 1 = 𝟎. 𝟐𝟒𝟕 ? ? b) 𝑃 𝑌 ≥ 1 = 𝟎. 𝟐𝟗𝟓 b) 𝑃 𝑋 ≥ 1 = 𝟎. 𝟗𝟎𝟎 ? ? c) 𝑃 4 < 𝑋 < 6 = 𝟎. 𝟎𝟓𝟑𝟖 ? ? c) 𝑃 1 ≤ 𝑌 < 3 = 𝟎. 𝟐𝟗𝟎 Given 𝑋~𝑃𝑜 3.6 find a) 𝑃 𝑋 = 5 = 𝟎. 𝟏𝟑𝟖 ? b) 𝑃 3 < 𝑋 ≤ 6 = 𝟎. 𝟒𝟏𝟐 ? c) 𝑃 𝑋 < 2 = 𝟎. 𝟏𝟐𝟔 ? Mean and Variance If the average rate of events is 𝜆 (say per hour), then what is the expected number of events that occur say next hour? ! 𝐸 𝑋 =𝜆 ? 𝑉𝑎𝑟 𝑋 = 𝜆 ? Using Tables Again, we can use tables for the Cumulative Distribution Function of a Poisson Distribution. On average 8 cars come down a country road an hour. What’s the probability that: a) Less than 5 cars pass in the next hour? 𝝀=𝟖 𝑷 𝑿 < 𝟓 = 𝑷(𝑿?≤ 𝟒) = 𝟎. 𝟎𝟗𝟗𝟔 b) At least 3 cars pass? 𝑷 𝑿 ≥ 𝟑 = 𝟏 − 𝑷 𝑿 ? ≤ 𝟐 = 𝟎. 𝟗𝟖𝟔𝟐 c) Between 2 and 5 (inclusive) cars. 𝑷 𝟐≤𝑿≤𝟓 =𝑷 𝑿≤𝟓 −𝑷 𝑿≤ ? 𝟏 = 𝟎. 𝟏𝟗𝟏𝟐 − 𝟎. 𝟎𝟎𝟑𝟎 = 𝟎. 𝟏𝟖𝟖𝟐 Properties of Poisson Distribution We saw with in order to model something with a Binomial Distribution, we had to make some assumptions, e.g. each event was independent, and had two outcomes. We have similar restrictions on events for a Poisson Distribution: This means we can’t have multiple events occurring at once. We treat events as instantaneous. ! Events must occur: • Singly in time. If an event occurred just a moment ago, another one is no less likely to occur now than it a while later.. • Independently of each other. • At a constant rate in the sense that the mean number of occurrences in the interval is proportional to the length of the interval. You can usually tell in an exam if a Poisson Distribution is intended if the word ‘rate’ is used. Jan 2012 Q4 Poisson (or?𝑷𝒐 𝟓 ) (From mark scheme) Hits occur singly in time Hits are independent or hits occurs randomly Hits occur at a constant rate ? Poisson or not Poisson? Given these restrictions, which of the following could we model using a Poisson Distribution (where any reasonable simplifying assumptions are justifiable) A volcano erupts every 1000 years, and we’re interested in the probability of at least one eruption next year. If a volcano erupted today and then finished erupting, it’s ? events are not independent. less likely to erupt next year. So On average the 281 bus comes 10 times an hour. We’re interested in the probability of (at least one) bus coming in the next hour. Definitely not. Buses aren’t equally likely to come at any moment – the probability is going to spike each 6 minutes since buses intend to come at?regular intervals, not randomly. A call centre receives on average 80 calls an hour, and wish to work out the probability they have over 100 calls at some hour in the day. Yes, justified, provided that the average rate is constant. We’re making some simplifying ? assumptions, such as that we don’t have repeat calls from the same customer. General Questions Bro Tip: Think carefully about whether we wish to use Binomial or Poisson. May 2011 Q5 Bro Tip: Sometimes we need to scale the rate to a different time period/length. a If 0.5 defects occur per 10cm, 5 defects occur per 100cm 𝑋~𝑃𝑜 5 ? 𝑃 𝑋 ≤ 3 = 0.2650 b From (a), the probability that any given blank has at most 3 defects is 0.2650. We have 6 planks, and a Binomial Distribution over the count of how many are defective out of 6. Bro Tip: You should be clear about what your ? 𝟔, 𝟎. 𝟐𝟔𝟓𝟎 Let 𝒀 be the number of defective planks. 𝒀~𝑩 random variables are and how they’re distributed. 𝑃 𝑌 <2 =𝑃 𝑌 =0 +𝑃 𝑌 =1 = 0.7356 + 6 × 0.265 × 0.7355 = 𝟎. 𝟒𝟗𝟖𝟕 … Test Your Understanding A shop sells radios at a rate of 2.5 per week. a) Find the probability that in a two-week period the shop sells at least 7 radios. b) Deliveries of these radios come every 4 weeks. Find the probability of selling fewer than 12 radios in a four-week period. c) The manager wishes to make sure that the probability of the shop running out of radios during a four-week period is less than 0.01. Find the smallest number of radios the manager should have in stock immediately after the delivery. a 𝑋 =the number of radios sold in a two-week period 𝑋~𝑃𝑜 5 𝑃 𝑋 ≥7 =1−𝑃 𝑋 ≤6 ? = 0.2378 b 𝑌 = the number of radios sold in a four-week period 𝑌~𝑃𝑜 10 𝑃 𝑌 < 12 = 𝑃 𝑌 ≤ 11 ? = 0.6968 c Let 𝑠 = the number the manager should have in stock 𝑃 𝑌 > 𝑠 < 0.01 → 𝑃 𝑌 ≤ 𝑠 > 0.99 ? Using the table, we find 𝑠 = 18. Bro Tip: The method/principle her is exactly the same as with Binomial questions. Exercise 2 1 Bob makes on average 5 burgers and hour. He makes burgers across a 2 hour period. a) Calculate the probability he makes 8 burgers in this period. 3 𝑿~𝑷𝒐 𝟏𝟎 𝑷 𝑿 = 𝟖 = 𝟎. 𝟏𝟏𝟑 ? b) 𝑿~𝑷𝒐 𝟑 𝑷 𝑿 ≥ 𝟓 = 𝟎. 𝟏𝟖𝟒𝟕 ? Calculate the probability he makes at least 3 burgers. b) ? 𝑷 𝑿≥𝟑 =𝟏−𝑷 𝑿≤𝟐 = 𝟎. 𝟗𝟗𝟕𝟐 c) What is the most burgers he can make such that there is at most a 5% chance of making less than this number of burgers? 𝑷 𝑿 < 𝒙 ≤ 𝟎. 𝟎𝟓 𝑷 𝑿 ≤ 𝒙 − 𝟏 ≤ 𝟎. 𝟎𝟓 Using table, 𝒙 − 𝟏 = 𝟒 So 𝒙 = 𝟓 ? 2 Chelsea dates on average 6 men a week. She considers it a ‘good week’ if she dated at least 4 men. a) Calculate the probability it’s been a good week. 𝑿~𝑷𝒐 𝟔 𝑷 𝑿 ≥ 𝟒 = 𝟎. 𝟖𝟒𝟖𝟖 b) She considers it a ‘good month’ if she’s had at least 3 good weeks out of 4. Calculate the probability she’s had a good month. 𝒀 = count of good weeks, 𝒀~𝑩 𝟒, 𝟎. 𝟖𝟒𝟖𝟖 𝑷 𝒀≥𝟑 =𝑷 𝒀=𝟑 +𝑷 𝒀=𝟒 = 𝟒 × 𝟎. 𝟖𝟒𝟖𝟖𝟑 × 𝟎. 𝟏𝟓𝟏𝟐 + 𝟎. 𝟖𝟒𝟖𝟖𝟒 = 𝟎. 𝟖𝟖𝟖𝟗 ? ? For each 10 lines of programming there’s 0.6 bugs. a) If I write a program 50 lines long, what’s the probability I make at least 5 bugs? Mike the IT boss wants to downsize his company. He wants to fire as many people as possible but is not allowed to exceed 1%. Every employee writes a 50 line program. What the number of bugs he should set such that they will be sacked if they make at least this number? 𝑷 𝑿 ≥ 𝒙 ≤ 𝟎. 𝟎𝟏 𝑷 𝑿 ≤ 𝒙 − 𝟏 ≥ 𝟎. 𝟗𝟗 𝒙−𝟏=𝟖 𝒙=𝟗 ? 4 Fred gets a bonus each day if makes more than 11 sales that day. On average he makes 8.5 sales a day. He can take his kids to Disneyland if across the next month (30 days) he makes a bonus on at least 2 days. Calculate the probability that he gains the respect of his kids and saves his marriage. 𝑿 = sales each day, 𝑿~𝑷𝒐(𝟖. 𝟓) 𝑷 𝑿 > 𝟏𝟏 = 𝟏 − 𝑷 𝑿 ≤ 𝟏𝟏 = 𝟎. 𝟏𝟓𝟏𝟑 𝒀 = days bonus made 𝒀~𝑩 𝟑𝟎, 𝟎. 𝟏𝟓𝟏𝟑 𝑷 𝒀≥ 𝟐 = 𝟏−𝑷 𝒀= 𝟎 −𝑷 𝒀= 𝟏 = 𝟏 − 𝟎. 𝟖𝟒𝟖𝟕𝟑𝟎 − 𝟑𝟎 × 𝟎. 𝟏𝟓𝟏𝟑 × 𝟎. 𝟖𝟒𝟖𝟕𝟐𝟗 = 𝟎. 𝟗𝟓𝟑𝟕 ? Approximating a Binomial using a Poisson Earlier we saw how we could solve problems involving rates using a Binomial Distribution, where we’d split up the time period into intervals where in each the event 𝜆 either happened or it didn’t, where 𝑝 = 𝑛. 3pm 2pm We saw that the Poisson Distribution is obtained when we divided time into more and more chunks (i.e. where 𝑛 became infinitely large). Note also that 𝑝 is small because in a very short time interval, the probability of the event occurring is low. This naturally leads us to: ! If 𝑋~𝐵(𝑛, 𝑝) and: 𝑛 is large 𝑝 is small Then 𝑋 can be approximated by 𝑃𝑜 𝑛𝑝 Generally if 𝑛𝑝 ≤ 10 then a Poisson is suitable enough approximation, but in an exam, use the original Binomial unless instructed to approximate. Why would we want to approximate? 𝑋~𝐵 𝑛, 𝑝 𝑛 𝑥 𝑃 𝑋=𝑥 = 𝑝 1−𝑝 𝑥 𝑋~𝑃𝑜(𝑛𝑝) 𝑛−𝑥 𝑒 −𝜆 𝜆𝑥 𝑃 𝑋=𝑥 = 𝑥! For the Binomial Distribution, the probability involves 𝑛 = 𝑥! 𝑥 𝑛! 𝑛−𝑥 ! When 𝑛 is really large, calculating 𝒏! is really horrid. However, the probability function for the Poisson Distribution doesn’t involve 𝑛! so avoids the problem. Note also that 𝜆 = 𝑛𝑝 is not too large (as 𝑝 is small) and so 𝑒 −𝜆 is not too difficult to compute. Quickfire State whether you would use a Poisson Approximation for each Binomial (recall: 𝑛𝑝 ≤ 10), and state the distribution used as the approximation. ? 𝑋~𝐵(100, 0.1) 𝑋~𝑃𝑜 10 𝑋~𝐵(50, 0.5) Poisson approximation not ? appropriate as 𝑛𝑝 = 25. 𝑋~𝐵(40, 0.02) 𝑋~𝑃𝑜 8 𝑋~𝐵(300, 0.2) Poisson approximation not appropriate as 𝑛𝑝 ? = 60. ? Exercise 3 May 2013 Q7d 𝒏𝒑 = 𝟓 ≤ 𝟏𝟎 so use 𝑿~𝑷𝒐(𝟓) 𝑷 𝑿 > 𝟏𝟎 = 𝟏 − 𝑷 𝑿?≤ 𝟏𝟎 = 𝟎. 𝟎𝟏𝟑𝟕 Jan 2013 Q1b 𝑿~𝑷𝒐 𝟏𝟎 𝑷 𝑿≥𝟒 = 𝟏−𝑷 𝑿≤𝟑 ? = 𝟎. 𝟗𝟖𝟗𝟕 June 2009 Q1 a) 𝑿~𝑩 𝟑𝟎, 𝟎. 𝟏𝟓 𝑷 𝑿 ≤ 𝟔 = 𝟎. 𝟖𝟒𝟕𝟒 b) 𝒀~𝑩 𝟔𝟎, 𝟎. 𝟏𝟓 ≈ 𝑷𝒐 𝟗 𝑷 𝒀 ≤ 𝟏𝟐 = 𝟎. 𝟖𝟕𝟓𝟖 ? Summary of S2 so far… 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) 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 𝜆 ? Prob Func 𝑝 𝑥 = 1 𝜎 2𝜋 𝑒 − 𝑥−𝜇 2 2𝜎 2 𝑬𝑿 𝑽𝒂𝒓 𝑿 𝜇 𝜎2 𝑛𝑝 𝑛𝑝 1 − 𝑝 𝜆 𝜆 ? ? Oddly, this is in your S1 formula sheet, but you never used it! 0, 1, … , 𝑛 𝑝 𝑥 = 𝑛 𝑥 𝑝 1−𝑝 𝑥 𝑥 Probability of success in each trial 𝑝 ? ℕ (including 0) ? 𝑝 𝑥 =𝑒 ? −𝜆 𝜆𝑥 𝑥! APPENDIX: Proof of Poisson Probability Function 𝑛 𝑥 Prove that lim 𝑝 1−𝑝 𝑛→∞ 𝑥 𝑛−𝑥 = 𝑒 −𝜆 𝜆𝑥 𝑥! 𝑥 𝑛−𝑥 𝜆 𝜆 1− 𝑛 𝑛 𝑛 𝑛−1 𝑛−2 … 𝑛−𝑥+1 = lim 𝑛→∞ 𝑥! 1 2 𝑥−1 1 1−𝑛 1−𝑛 … 1− 𝑛 = lim 𝑛→∞ 𝑥! 𝑛 lim 𝑛→∞ 𝑥 1 𝜆 (where 𝑤ℎ𝑒𝑟𝑒 𝑝 = 𝑛) 2 𝜆𝑥 𝑛𝑥 𝜆 1− 𝑛 𝜆𝑥 𝜆 1− 𝑛 𝑛−𝑥 𝑛−𝑥 But given 𝑛 → ∞, 1 − 𝑛 → 1, 1 − 𝑛 → 1 and so on. The numerator therefore simplifies to 1. Also, as 𝑛 → ∞, 𝑛 − 𝑥 → 𝑛 (i.e. infinity minus a finite number is still infinity!) So: 𝑛−𝑥 𝑛 𝜆 𝜆 lim 1 − = lim 1 − = 𝑒 −𝑘 𝑛→∞ 𝑛→∞ 𝑛 𝑛 (this is a standard result which we won’t prove here)