Learn · Chapter 9

The exponential distribution

Waiting times, memorylessness and the link to the Poisson.

Waiting times

The Poisson counts events in an interval; the exponential distribution measures the time between them. When events arrive independently at a steady rate \(\lambda\), the wait \(T\) until the next one is exponential:

The density is highest at 0 and falls away: short waits are the most common, and a few waits are very long. The distribution is skewed to the right, so its median, \(\tfrac{\ln 2}{\lambda}\), is below its mean.

Time between arrivals

Customers arrive at a café at 12 an hour, which is \(\lambda = 0.2\) a minute, so the average gap is \(\tfrac{1}{0.2} = 5\) minutes. The chance that the next customer arrives within 2 minutes is \(1 - e^{-0.4} = 0.3297\). The chance that the barista waits more than 10 minutes is \(e^{-2} = 0.1353\). Half of all gaps are shorter than \(\tfrac{\ln 2}{0.2} = 3.4657\) minutes, well under the mean of 5, and one gap in ten is longer than \(F^{-1}(0.9) = 11.5129\) minutes.

x = 10

P(X > 10) = 0.1353

Open this set-up in the explorer
The gap between customers arriving at 0.2 a minute, with P(T > 10) shaded

The link to the Poisson

Waiting more than \(t\) for the next event is the same as seeing no event in an interval of length \(t\). The number of events in that interval is \(\text{Poisson}(\lambda t)\), whose chance of 0 is \(e^{-\lambda t}\):

For the café, no customer in 10 minutes is a Poisson count with \(\lambda t = 2\) equal to 0, with probability poisson.pmf(0, 2) = 0.1353, exactly the exponential's \(P(T > 10)\). The two distributions describe one process: the Poisson counts the arrivals and the exponential times the gaps.

Memorylessness

An electronic component fails at random, with no wear, at an average rate of once in 2,000 hours: its lifetime is exponential with \(\lambda = \tfrac{1}{2000}\). The chance that it lasts more than 1,000 hours is \(e^{-0.5} = 0.6065\). Now suppose it has already run for 3,000 hours. The chance that it lasts another 1,000 is

the same as for a new one. The exponential has no memory: \(P(T > s + t \mid T > s) = P(T > t)\). The time already waited tells you nothing about the time still to wait. It also means that more than half of the components fail before the average lifetime: \(P(T \le 2000) = 1 - e^{-1} = 0.6321\).

Try this Measure the lifetime in thousands of hours (λ = 0.5 per thousand hours) and ask the explorer for the chance of lasting past 1; the answer is the chance of lasting another 1 at any age.

Checking it against data

A model is only as good as its fit. The lab's 2,000 bug-fix times average 2.9655 hours, and an exponential with that mean says a fix takes more than 5 hours with probability \(e^{-5/2.9655} = 0.1852\), and less than 1 hour with probability 0.2862. The data have neither: every fix took between 1 and 5 hours, because they are uniform. The histogram shows it at once.

2,000 values · mean 2.9655 · standard deviation 1.1351 · fitted Exp(λ = 0.3372)

Open in the data-fit labDownload bug-fix-times.csv
2,000 bug-fix times with an exponential of the same mean: the data are flat between 1 and 5 hours, the exponential is not

When the exponential is the wrong tool

  • Wear-out. Tyres, bearings and batteries are more likely to fail the older they get. A lifetime with memory needs another model, such as the Weibull.
  • A rate that changes. Arrivals at a café in the lunch rush and in mid-afternoon have different rates, so their gaps are not one exponential.
  • A minimum time. A bug fix never takes under an hour and a delivery never under ten minutes; the exponential's likeliest wait is 0.
  • Scheduled events. A bus every 10 minutes gives gaps of 10 minutes, not exponential ones.

In code

What it computes Python (scipy.stats) Excel
The next customer within 2 minutes expon.cdf(2, scale=5) =EXPON.DIST(2, 0.2, TRUE)
A wait of more than 10 minutes expon.sf(10, scale=5) =1-EXPON.DIST(10, 0.2, TRUE)
The median gap expon.median(scale=5) =LN(2)/0.2
No customer in 10 minutes poisson.pmf(0, 2) =POISSON.DIST(0, 2, FALSE)
A component lasting 1,000 hours expon.sf(1000, scale=2000) =EXP(-1000/2000)

scipy's expon takes the mean, scale = 1/λ; Excel's EXPON.DIST takes the rate λ. Mixing them up is the commonest mistake with the exponential.

Remember: The exponential is the time between events arriving at rate \(\lambda\): mean \(\tfrac{1}{\lambda}\), \(P(T > t) = e^{-\lambda t}\), the Poisson's chance of no event in \(t\). It has no memory, so it suits random failures and arrivals, not wear-out or schedules.

Practise

Quiz

Three questions on the chapter. Your best score is kept in this browser.

1. Customers arrive at 12 an hour. What is the mean time between arrivals?
2. A component with an exponential lifetime has run for 3,000 hours. How does its chance of lasting another 1,000 hours compare with a new one's?
3. Which Python call gives the chance of a wait over 10 minutes when events arrive at 0.2 a minute?
Answer every question first.
An unhandled error has occurred. Reload 🗙

Reconnecting…

Your connection to Introduction to Probability Lab dropped, probably a Wi-Fi blip. Hold on while it reconnects.

The connection could not be restored. The page will reload in a few seconds.