Skip to content
Tutorials Center
My learning

Topics

Lesson 24 of 57 ยท Common Distributions

Exponential and Geometric Distributions

Model waiting times with the exponential and geometric distributions: formulas, the memoryless property, link to Poisson and binomial, and runnable Python examples.

The Poisson and binomial distributions count events. Two related distributions ask a different question: how long do we wait? How many attempts until the first success is the geometric distribution. How much time until the next event is the exponential distribution. They are the "waiting time" cousins of the binomial and Poisson, and they share a surprising feature: they forget the past.

The geometric distribution

Repeat independent Bernoulli trials with success probability p until the first success. Let X be the trial on which that first success occurs, so X is 1, 2, 3, ... Success on trial k means k - 1 failures followed by one success:

TEXT
P(X = k) = (1 - p)^(k - 1) * p,   k = 1, 2, 3, ...
E[X]   = 1 / p
Var(X) = (1 - p) / p^2
P(X > k) = (1 - p)^k

If a die shows 6 with probability 1/6, you wait on average 6 rolls for your first six. Some libraries (including R) count only the failures before the first success; SciPy's geom counts trials, as above.

Python Waiting for the first six

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The exponential distribution

Suppose events arrive as a Poisson process with rate r per unit time. The time T until the next event is a continuous variable with the exponential distribution:

TEXT
f(t) = r * e^(-r t),   t >= 0
P(T > t) = e^(-r t)
P(T <= t) = 1 - e^(-r t)
E[T] = 1 / r,   Var(T) = 1 / r^2

If calls arrive at 12 per hour, the mean waiting time is 1/12 hour, or 5 minutes. The exponential is right-skewed: short waits are common, and long ones are possible. Note that SciPy parametrizes it by scale = 1 / r (the mean), not by the rate.

Python Time between calls

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Notice the median (about 3.5 minutes) is smaller than the mean (5 minutes): the long tail pulls the mean up.

The memoryless property

Both distributions are memoryless. Suppose you have already waited s units without success. The chance of waiting at least t more is the same as if you had just started:

TEXT
P(T > s + t | T > s) = P(T > t)

For the geometric distribution this follows because each new trial is independent of the old ones: a coin that has shown ten tails is no more "due" for heads. For the exponential it follows from e^(-r(s+t)) / e^(-r s) = e^(-r t). These are the only distributions on their supports with this property.

Python Checking memorylessness by simulation

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Memorylessness does not fit things that wear out. A lightbulb that has burned 1,000 hours is more likely to fail soon than a new one, so an exponential model is wrong for aging. Use a Weibull or gamma model there.

Connecting the four distributions

flowchart TD
    A["Bernoulli trials"] --> B["Count successes in n: Binomial"]
    A --> C["Trials until first success: Geometric"]
    D["Poisson process"] --> E["Count events in a window: Poisson"]
    D --> F["Time until next event: Exponential"]

Counting versus waiting, in discrete and continuous settings.

The geometric is the discrete version of the exponential: if you slice time into tiny steps with a small chance of an event in each step, the number of steps until the first event is nearly exponential.

Which one do I use?

  • Number of successes in a fixed number of trials: binomial.
  • Number of events in a fixed time window: Poisson.
  • Number of trials until the first success: geometric.
  • Time until the next event (or between events): exponential.

Always check units. If the rate is per hour and the question is in minutes, convert first.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. A basketball player makes a free throw with probability 0.8. What is the expected number of attempts until the first made shot?

    For the geometric distribution the mean is 1 / p = 1 / 0.8 = 1.25 attempts.
  2. 2. Buses arrive at 3 per hour (Poisson). What is the mean waiting time for the next one?

    The mean wait is 1 / rate = 1/3 hour = 20 minutes.
  3. 3. What does memoryless mean?

    P(T > s + t | T > s) = P(T > t): time already waited gives no information.
  4. 4. You have rolled 20 times without a six. The probability the next roll is a six is:

    Trials are independent, so the chance stays 1/6; the gambler's fallacy says otherwise.

Summary

  • Geometric: trials until the first success; P(X = k) = (1-p)^(k-1) p, mean 1/p.
  • Exponential: time until the next event at rate r; P(T > t) = e^(-r t), mean 1/r.
  • Both are memoryless, which makes them unsuitable for things that age.
  • They pair with the binomial and Poisson as waiting-time versions.

Next: The Normal Distribution