Skip to content
Part IA Easter Term

Geometric Distribution

Definition

X∼Geo(p)X \sim \text{Geo}(p) counts the number of Bernoulli trials until the first success, where each trial is independent with success probability pp.

PMF

P(X=n)=(1−p)n−1p,n=1,2,3,…P(X = n) = (1-p)^{n-1} p, \quad n = 1, 2, 3, \ldots

Why this formula? To have X=nX = n:

  • First n−1n-1 trials must fail: probability (1−p)n−1(1-p)^{n-1}
  • Trial nn succeeds: probability pp

Range

X∈{1,2,3,…}X \in \{1, 2, 3, \ldots\} (positive integers, starting at 1)

Expectation

E[X]=∑n=1∞n⋅(1−p)n−1pE[X] = \sum_{n=1}^{\infty} n \cdot (1-p)^{n-1} p

Using ∑n=1∞nrn−1=1(1−r)2\sum_{n=1}^{\infty} n r^{n-1} = \frac{1}{(1-r)^2} for ∣r∣<1|r| < 1:

E[X]=p⋅1p2=1pE[X] = p \cdot \frac{1}{p^2} = \frac{1}{p}

Intuition: If success has probability pp, on average you need 1/p1/p trials.

Example

For a fair coin (p=0.5p = 0.5), expected number of flips until heads is E[X]=2E[X] = 2.

If p=0.1p = 0.1, expected trials until success is E[X]=10E[X] = 10.

Variance

Var(X)=1−pp2\text{Var}(X) = \frac{1-p}{p^2}

Derivation: Using E[X2]=2−pp2E[X^2] = \frac{2-p}{p^2}, we get Var(X)=E[X2]−E[X]2=2−pp2−1p2=1−pp2\text{Var}(X) = E[X^2] - E[X]^2 = \frac{2-p}{p^2} - \frac{1}{p^2} = \frac{1-p}{p^2}.

Memoryless Property

The geometric distribution is the only discrete distribution that is memoryless:

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

Interpretation: If you’ve already waited mm trials without success, the probability of waiting at least nn more trials is the same as starting fresh.

Proof

P(X>n)=(1−p)nP(X > n) = (1-p)^n

P(X>m+n∣X>m)=P(X>m+n)P(X>m)=(1−p)m+n(1−p)m=(1−p)n=P(X>n)P(X > m + n \mid X > m) = \frac{P(X > m + n)}{P(X > m)} = \frac{(1-p)^{m+n}}{(1-p)^m} = (1-p)^n = P(X > n)

Example

Flip a coin until heads appears. If you’ve flipped 10 tails already, the probability of flipping at least 5 more is the same as if you just started fresh. The coin has no memory.

CDF

F(n)=P(X≤n)=1−(1−p)nF(n) = P(X \leq n) = 1 - (1-p)^n

This is the probability of at least one success in nn trials.

Examples

Example 1: Coin Flips

Flip a fair coin until heads. X∼Geo(0.5)X \sim \text{Geo}(0.5).

  • P(X=1)=0.5P(X = 1) = 0.5
  • P(X=2)=0.5×0.5=0.25P(X = 2) = 0.5 \times 0.5 = 0.25
  • P(X=3)=0.52×0.5=0.125P(X = 3) = 0.5^2 \times 0.5 = 0.125
  • E[X]=2E[X] = 2

Example 2: Bit Generation

Generate random bits until the first 1, where each bit is 1 with probability p=0.3p = 0.3.

E[X]=10.3≈3.33E[X] = \frac{1}{0.3} \approx 3.33

P(X≤5)=1−(0.7)5=1−0.168=0.832P(X \leq 5) = 1 - (0.7)^5 = 1 - 0.168 = 0.832

Example 3: Network Packets

A network sends packets until acknowledgment received. Packet loss rate is 5%.

Expected packets sent until acknowledgment:

E[X]=10.95≈1.053E[X] = \frac{1}{0.95} \approx 1.053

Alternative Convention

Some textbooks define geometric distribution starting at 0:

Y=X−1∼Geo0(p)Y = X - 1 \sim \text{Geo}_0(p)

This counts failures before first success. Then Y∈{0,1,2,…}Y \in \{0, 1, 2, \ldots\} with:

E[Y]=1−pp,Var(Y)=1−pp2E[Y] = \frac{1-p}{p}, \quad \text{Var}(Y) = \frac{1-p}{p^2}

Always check which convention is being used.

Relation to Other Distributions

  • Bernoulli: Each trial is Bernoulli(p)(p)
  • Binomial: Counts successes in nn trials; geometric counts trials until first success
  • Negative Binomial: Counts trials until rrth success; geometric is the special case r=1r = 1

Summary

PropertyValue
PMFP(X=n)=(1−p)n−1pP(X = n) = (1-p)^{n-1} p
Range{1,2,3,…}\{1, 2, 3, \ldots\}
Mean1p\frac{1}{p}
Variance1−pp2\frac{1-p}{p^2}
MemorylessP(X>m+n∣X>m)=P(X>n)P(X > m + n \mid X > m) = P(X > n)
CDFF(n)=1−(1−p)nF(n) = 1 - (1-p)^n