Assume that number of calls that some call center receives during one minute is Poisson random variable with parameter λ=2. Use Python to find probability that number of calls is larger than 5. Enter number with first 5 digits after the decimal point.
I wonder if I understand and solve this task correctly using scipy.stats.poisson?
from scipy.stats import poisson import numpy as np mu = 2 # lambda k = 6 # number of calls is larger than 5? pmf = poisson.pmf(k, mu) print(pmf)
My output is 0.012029802954365565
Here is the second part of the task:
Assume now that one operator can handle one call in one minute. If call is not handled, it’s missed. How many operators should I hire to be sure that probability to miss a call during one minute is not larger than 0.05? Of course I want to minimize number of operators hired.
Hint: scipy.stats random variables have .ppf method that calculates percent point function (also known as quantile function) that is inverse function for CDF. For any value p it finds a minimal value q such that CDF(q)≥p.
ppf = poisson.ppf(cdf, mu)
Am I using ppf correctly?
It gives 5.0 as answer.
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
pmf stands for Probability mass function, which means you have the probability that 6 calls arrive in one minute. I think you look for the Cumulative distribution function cdf = 1- poisson.cdf(k=5, mu). Since the F(x) = P(X <= x), where x=5.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0