distribution #7
In this lesson

Wide tables, equations, and code scroll sideways. Swipe, or Tab to focus them and use the left and right arrow keys.

Geometric distribution

You will learn: Choose a waiting-count convention and compute conditional remaining waits.

Start with: Bernoulli distribution

Flip a biased coin with success probability p until the first head. The number of flips needed follows a Geometric distribution. One parameter does all the work.

P(X=k)=(1−p)k−1pP(X=k)=(1-p)^{k-1}p
probability by trials through first success 00.10.20.324681012trials through first successprobability

P(trials≤5) = 0.831930; P(exactly 5) = 0.0720300; P(trials>5) = 0.168070. Mean under this convention: 3.3333.

Condition on having already waited

G counts trials including the first success, under either display convention
EventExact probability
G > 30.343000
G > 50.168070
G > 5, given G > 30.490000
Fresh G > 20.490000

163 of 500 simulated waits survive 3 failures. 87 of those survive 2 further failures: 0.5337. These are uncensored complete waits. 9 exceed the plotted window; omitted theoretical mass is 0.013841 and all runs stay in the histogram denominator.

Dark bars: PMF P(X=k)=(1−p)k−1pP(X=k)=(1-p)^{k-1}p. Light bars: empirical frequencies from 500 samples. E[X]=1/pE[X]=1/p = 3.3 trials.

What to notice

  • Small p produces a long, geometrically decaying right tail — most runs take many trials, but occasionally the first flip succeeds.
  • Large p pushes almost all probability onto k=1 and k=2 — success comes quickly.
  • Mean E[X]=1/pE[X]=1/p and variance Var(X)=(1−p)/p2\text{Var}(X)=(1-p)/p^2 both grow as p shrinks.

Memorylessness

For independent trials with a fixed known p, past failures do not change the success probability on the next trial.

P(X>m+n∣X>m)=P(X>n)P(X>m+n\mid X>m)=P(X>n)

If you’ve already failed m times, the distribution of remaining trials looks exactly like starting fresh. Among distributions on the positive integers, this property characterizes the geometric law. The exponential is its nondegenerate continuous counterpart on nonnegative waiting times.

Connection to the exponential

Split time into intervals of length δ. In a homogeneous Poisson process, an interval contains at least one event with probability p = 1 − exp(−λδ). The number G of intervals until the first nonempty one is geometric. As δ tends to zero, the waiting time δG converges in distribution to Exponential(λ). They are the same memorylessness expressed in discrete vs continuous time.

Count the successful trial consistently

Suppose the outcomes are failure, failure, success. The trial count G is three; the failure count K=G−1 is two. At p=0.3, both descriptions assign this sequence probability 0.7²×0.3=0.147. They describe the same experiment, with means 1/p≈3.333 and (1−p)/p≈2.333. The variance is unchanged by subtracting one.

For G≤5, the complement is five consecutive failures: P(G>5)=0.7⁵=0.16807, so P(G≤5)=0.83193. For K≤5, six trials are allowed; the probability is 1−0.7⁶=0.882351. Switch the convention without changing the numeric threshold to see why software parameter conventions matter.

Decompose the remaining wait

At p=0.3, P(G>3)=0.343 and P(G>5)=0.16807. Among runs surviving three failures, the chance of two more failures is 0.16807/0.343=0.49. A fresh run also has probability 0.7²=0.49 of failing twice. The control uses the surviving group as denominator, including waits beyond the chart; an empty simulated group has no empirical conditional probability.

A first-step calculation also explains the mean: one trial is always used. With probability 1−p it fails and the remaining wait has the original distribution. Thus E[G]=1+(1−p)E[G], giving 1/p. Adding r independent waits gives the total-trial version of a negative binomial.

Make a prediction

One marked item is hidden uniformly among ten items. After five distinct failures without replacement, is the next success probability still one tenth?

Explore the answer

No. Five candidates remain and one is marked, so the next probability is one fifth. The geometric model needs independent trials with a common p. Sampling without replacement changes that probability. An unknown p can also be updated after failures, unlike the fixed-p model here.

Reference

Random Services: geometric distribution develops both counting conventions, the survival identity, and the first-step expectation argument. The exponential experiment compares memorylessness with changing-hazard alternatives.

Reset all settings