Quant Memo
Foundational

The Geometric Distribution

The distribution for "how many tries until the first success" — one number, the success probability, controls the whole thing. It's the discrete cousin of the exponential and the only discrete distribution with no memory.

Prerequisites: The Binomial Distribution

The geometric distribution answers a very natural question: you keep trying the same thing over and over, each attempt succeeds with the same probability, so how many attempts until the first success? Flip a coin until it lands heads, send quotes until one fills, roll a die until you get a six. The count of tries is geometric, and remarkably, a single number, the per-try success probability, tells you everything about it.

Each attempt is an independent Bernoulli trial: it succeeds with probability pp and fails with probability 1p1 - p. To have your first success land on try number kk, you need the first k1k-1 tries to all fail and the kk-th to succeed. Multiply those independent chances together:

P(X=k)=(1p)k1p,k=1,2,3,P(X = k) = (1 - p)^{k-1}\, p, \qquad k = 1, 2, 3, \dots

Here XX is the trial on which the first success occurs, pp is the success probability of a single try, and (1p)k1(1-p)^{k-1} is the chance of failing the first k1k-1 times in a row. The counts run 1,2,3,1, 2, 3, \dots with no upper bound: you might, in principle, wait forever.

1 2 3 4 5 6 7 8 mean = 1/p = 2.5 Geometric(p = 0.4)
Every bar is shorter than the last: the single most likely outcome is always "success on the very first try." Yet the average wait, 1/p, sits further right because a long thin tail of unlucky runs drags the mean along.

The average wait is one-over-p

The mean and variance are worth memorising:

E[X]=1p,Var(X)=1pp2.E[X] = \frac{1}{p}, \qquad \operatorname{Var}(X) = \frac{1 - p}{p^2} .

The mean has a beautifully simple reading: if something works one time in pp, you wait 1/p1/p tries on average. A one-in-six event (rolling a six) takes six rolls on average; a coin's heads takes two flips.

For a first-success count, the expected number of tries is one over the success probability, E[X]=1/pE[X] = 1/p. A one-in-nn event takes about nn attempts on average.

Memorylessness

The geometric distribution has a strange and useful property: it forgets the past. Suppose you've already failed ten times. Does that "load the dice" for a success soon? No. The chance you need at least tt more tries is exactly the same as it was at the very start:

P(X>s+tX>s)=P(X>t).P(X > s + t \mid X > s) = P(X > t) .

Coins and dice don't keep score. A run of bad luck doesn't make you "due." The geometric is the only discrete distribution with this no-memory property, which is exactly why it's the discrete twin of the The Exponential Distribution, the continuous distribution that forgets in the same way.

"I've missed nine times, so I'm due" is the gambler's fallacy. Under a genuinely memoryless process the streak carries no information about the next try. Being due is a feeling, not a probability.

Worked example

You roll a fair die repeatedly until the first six. Here p=1/6p = 1/6.

  • Expected number of rolls: E[X]=1/p=6E[X] = 1/p = 6. On average it takes six rolls.
  • Chance the first six lands on roll 3: you need two non-sixes then a six,
P(X=3)=(56)2(16)=253616=252160.116.P(X = 3) = \left(\tfrac{5}{6}\right)^2 \left(\tfrac{1}{6}\right) = \frac{25}{36}\cdot\frac{1}{6} = \frac{25}{216} \approx 0.116 .
  • Chance it takes more than 6 rolls: all of the first six must miss,
P(X>6)=(56)60.335.P(X > 6) = \left(\tfrac{5}{6}\right)^6 \approx 0.335 .

So even though six rolls is the average, you'll still be waiting past six rolls about a third of the time, that fat right tail again.

To get P(X>k)P(X > k) fast, skip the sum. You just need kk failures in a row: P(X>k)=(1p)kP(X > k) = (1-p)^k. Everything else is one minus that.

A note on conventions

Two definitions float around and they differ by one. This page counts the trial of the first success (support 1,2,3,1, 2, 3, \dots, mean 1/p1/p). The other convention counts the number of failures before the first success (support 0,1,2,0, 1, 2, \dots, mean (1p)/p(1-p)/p). They describe the same experiment; just check which one a textbook or a library function means before plugging numbers in.

The geometric is the r=1r = 1 special case of the The Negative Binomial Distribution (wait for one success instead of rr), sits among the Common Distributions every quant should know, and its one-over-p mean is a direct application of Expected Value.

Related concepts

Practice in interviews

Further reading

  • Blitzstein & Hwang, Introduction to Probability, ch. 4
  • Ross, A First Course in Probability
ShareTwitterLinkedIn