9/11/2019

Customers at a coffee shop

A coffee shop serves an average of 75 customers per hour during the morning rush.

  1. Which distribution we have studied is most appropriate for calculating the probability of a given number of customers arriving within one hour during this time of day?
  2. What are the mean and the standard deviation of the number of customers this coffee shop serves in one hour during this time of day?
  3. Would it be considered unusually low if only 60 customers showed up to this coffee shop in one hour during this time of day?
  4. Calculate the probability that this coffee shop serves 70 customers in one hour during this time of day?

The Poisson Distribution

Intuition

  • The Bernoulli distribution encompasses a single YES/NO question. \[P(X = 1) = p\]
  • The binomial distribution encompasses a finite series of YES/NO questions. \[P(X = k) = {n \choose k}p^k(1-p)^{n-k}\]
  • The Poisson distribution is what happens when one changes perspective from a finite number of cases to what happens when the probability is a rate over some measure like time, area, or volume. \[P(X = k) = \frac{\lambda^k e^{-\lambda}}{k!}\]
  • I like this explanation, although I admit to bias.

Poisson process

The Poisson distribution describes events following a Poisson process:

  • Probability of event in an interval is solely proportional to the size of the interval

  • Nothing happens when the interval is of no size

  • Probability of two events happening simultaneously is effectively 0

Examples of Poisson random variables

Number of chocolate chips in a cookie

Number of cars passing a stretch of highway

Number of telephone calls to a switchboard

Number of hurricanes hitting a particular house

Number of sea lions foraging at a particular shore

Rate is proportional to time and area as no two sea lions can occupy the same exact space at the same time…

Examples of Poisson random variables

…No matter how hard they try!

Question 4.31—Answers

Part (a)

Which distribution we have studied is most appropriate for calculating the probability of a given number of customers arriving within one hour during this time of day?

The Poisson distribution

Part (b)

What are the mean and the standard deviation of the number of customers this coffee shop serves in one hour during this time of day?

The Poisson has its mean equal to its variance = \(\lambda\) so a mean of \(75\) customers and a standard deviation of \(\sqrt{75}\approx 8.66\) customers.

Part (c)

Would it be considered unusually low if only 60 customers showed up to this coffee shop in one hour during this time of day?

Yes. Exactly 60 would be rare, and even at most 60 is uncommon. As the Poisson is a counting distribution, to calculate 60 or fewer events, the cumulative distribution needs to be built up manually. There is a normal approximation, but R has built-in functions, dpois for the probability mass function and ppois for the cumulative distribution function:

\[ \begin{aligned} \textrm{dpois}(k, \lambda) = \frac{\lambda^k e^{-\lambda}}{k!}\quad \textrm{ppois}(n, \lambda) = \sum_{k=0}^n \frac{\lambda^k e^{-\lambda}}{k!} \end{aligned} \]

dpois(60, 75)
## [1] 0.01026632
ppois(60, 75)
## [1] 0.0433398

So the probability either way is low.

Part (d)

Calculate the probability that this coffee shop serves 70 customers in one hour during this time of day.

\[ \begin{aligned} P(X=70|\lambda=75) &= \frac{75^{70} e^{-75}}{70!}\\ &= \exp\left(70\ln(75) - 75 - \ln\Gamma(71)\right)\\ &\approx \exp\left(302.2242 - 75 - 230.439\right)\\ &\approx e^{-3.214876}\\ &\approx 0.04016033 \end{aligned} \]

dpois(70, 75)
## [1] 0.04016033
all.equal(exp(70*log(75) - 75 - lgamma(71)), dpois(70, 75))
## [1] TRUE

Questions?