Post

Probability Distribution: Geometric

The Geometric distribution counts trials until the first success: memoryless waiting, a planning quantile, and how it bridges to Exponential and Negative Binomial.

Probability Distribution: Geometric

Probability distributions, a field guide (10 posts). This is Geometric. See the series overview for the full map.

The Question It Answers

How many independent attempts do we make until the first success? Each attempt succeeds with the same probability $p$; the Geometric random variable $X$ is the trial on which the first success lands. It is the natural partner of the Binomial: same trials, but instead of fixing the number of attempts and counting successes, we fix “one success” and count attempts.

FieldContent
TypeDiscrete
Random variable$X$ = trial number of the first success
Support$X \in \{1, 2, 3, \dots\}$ (the “failures-before-success” convention starts at 0 instead)
Parameters$p$ = success probability per trial (dimensionless, $0 < p \le 1$)
Mean$1/p$ (a 1-in-10 event takes 10 attempts on average)
Variance$(1-p)/p^2$
SignatureThe only memoryless discrete distribution: past failures never change what comes next

Two conventions. The version above counts trials ($k = 1, 2, \dots$). A second common version counts failures before the first success ($k = 0, 1, \dots$), with PMF $(1-p)^k p$. Always check which one a library uses: scipy.stats.geom counts trials starting at 1.

Shape Before Formula

The PMF decays geometrically: each extra trial multiplies the probability by $(1-p)$, so the mass is highest at $k=1$ and falls off at a constant rate. A larger $p$ decays faster (success comes quickly); a smaller $p$ stretches the wait.

Geometric PMF for p = 0.2 and p = 0.5, plotted as two decaying curves over trials 1 to 20; both peak at k = 1 and fall geometrically, with the smaller p = 0.2 decaying more slowly to reflect a longer expected wait

\[P(X=k) = (1-p)^{k-1}\, p.\]

The reasoning is direct: to get the first success exactly on trial $k$, we need $k-1$ failures (probability $(1-p)^{k-1}$) followed by one success (probability $p$), and independence lets us multiply.

A Worked Example: Cold-Call Prospecting

Setup. A salesperson books a meeting on about 10% of cold calls ($p = 0.10$). Let $X$ be the call on which the first booking happens.

Check the assumptions. Each call is a yes/no trial; treating them as independent with a constant $p$ is only reasonable if prospects are similar and unordered. In reality $p$ varies (a warm lead is not a random dial), which widens the true spread, so read the numbers as a planning model, not a promise.

Exactly the 5th call: $P(X=5) = (0.9)^4 (0.1) \approx 0.066$.

The more useful questions use the tail and the quantile:

  • Survival, “still no booking after 5 calls”: $P(X > 5) = (0.9)^5 \approx 0.590$.
  • Planning quantile, “how many calls give at least a 95% chance of one booking?” We need $P(X \le k) = 1 - (0.9)^k \ge 0.95$, i.e. $(0.9)^k \le 0.05$, which gives $k \ge 29$. So 29 calls buy a 95% chance of at least one meeting, far more informative than the probability of success on any single chosen call.

Beyond “Exactly”: CDF and Survival

The two companion functions have clean closed forms (trials convention):

\[F(k) = P(X \le k) = 1 - (1-p)^k, \qquad S(k) = P(X > k) = (1-p)^k.\]

“At least one success within $k$ tries” is just $F(k)$, and the quantile above inverts it.

Memorylessness

The Geometric distribution is memoryless: given that the first $m$ trials all failed, the probability of waiting $n$ more is unchanged,

\[P(X > m+n \mid X > m) = P(X > n).\]

A coin that has come up tails ten times in a row is no more “due” for heads. This is exactly the discrete echo of the Exponential distribution’s memorylessness in continuous time, and it is a strong modeling assumption: any process with fatigue, learning, or aging violates it.

When It Fits, and When It Fails

  
AssumesIndependent trials, each with the same success probability $p$
Common violation$p$ differs across prospects or units; sampling without replacement from a finite batch breaks independence
Closest relativesNegative Binomial (wait for the $r$-th success, not just the first); Exponential (the continuous-time analogue)

A Minimal Code Check

1
2
3
4
5
6
7
from scipy.stats import geom

p = 0.10
geom.pmf(5, p)     # first success exactly on call 5 -> 0.066
geom.sf(5, p)      # still no success after 5 calls   -> 0.590
geom.ppf(0.95, p)  # calls for a 95% chance of one    -> 29
geom.stats(p, moments="mv")   # (mean, var) = (10.0, 90.0)

Appendix: Deriving the Mean and Variance

Write $q = 1 - p$, with support $k = 1, 2, \dots$ and $P(X = k) = q^{k-1}p$. Both moments come from differentiating the geometric series $\sum_{k\ge 0} q^k = 1/(1-q)$.

The Mean

\[E[X] = \sum_{k=1}^{\infty} k\,q^{k-1}p = p\sum_{k=1}^{\infty} k\,q^{k-1}.\]

Differentiating $\sum_{k\ge 0} q^k = 1/(1-q)$ term by term gives $\sum_{k\ge 1} k\,q^{k-1} = 1/(1-q)^2$. Since $1 - q = p$,

\[E[X] = p\cdot\frac{1}{(1-q)^2} = p\cdot\frac{1}{p^2} = \frac{1}{p}.\]

The interpretation is the memorable part: a 1-in-$p$ event takes $1/p$ attempts on average.

The Variance

We take the second factorial moment. Differentiating the series once more,

\[\sum_{k=2}^{\infty} k(k-1)\,q^{k-2} = \frac{2}{(1-q)^3},\]

and multiplying by $q$ to match the exponent in the PMF:

\[E[X(X-1)] = p\sum_{k=2}^{\infty} k(k-1)\,q^{k-1} = p\cdot\frac{2q}{(1-q)^3} = \frac{2q}{p^2}.\]

Then $E[X^2] = E[X(X-1)] + E[X] = 2q/p^2 + 1/p = (2q + p)/p^2$, so

\[\text{Var}(X) = \frac{2q + p}{p^2} - \frac{1}{p^2} = \frac{2q + p - 1}{p^2} = \frac{q}{p^2} = \frac{1-p}{p^2},\]

using $p + q = 1$, so that $p - 1 = -q$.


Where this sits in the series. Previous concept: Binomial (successes in a fixed number of trials). Next concept: Negative Binomial (trials until the $r$-th success). Closest cousin: Exponential (continuous waiting time). Series overview.

Enjoyed this article? Never miss out on future posts - follow me.
© Sayan Biswas. All rights reserved.