Skip to content

Geometric distribution formula and examples

5 min read

Short answer

If each independent trial succeeds with probability pp, the number of trials XX until the first success has a geometric distribution: P(X=k)=(1−p)k−1p,k=1,2,3,…P(X=k)=(1-p)^{k-1}p,\quad k=1,2,3,\dots The mean is E[X]=1pE[X]=\dfrac1p, and the chance of needing more than kk trials is P(X>k)=(1−p)kP(X>k)=(1-p)^k.

Bar chart123456p = 0.5: the first success is most likely on the very first try
The probabilities shrink by a factor of (1 − p) each step, giving the characteristic decaying shape.

Where the formula comes from

To first succeed on trial kk, the first k−1k-1 trials must fail (probability (1−p)k−1(1-p)^{k-1}) and trial kk must succeed (probability pp). The trials are independent, so you multiply. It is the "waiting time" companion of the binomial distribution.

Memorylessness

Having already failed mm times does not change the future: P(X>m+n∣X>m)=P(X>n)P(X>m+n\mid X>m)=P(X>n). The coin or die has no memory, so a streak of failures does not make a success "due".

Worked example

You roll a fair die until you get a six. Find the probability the first six occurs on roll 3, the probability it takes more than 3 rolls, and the expected number of rolls.

Here p=16p=\tfrac16.

P(X=3)=(56)216=25216≈0.116P(X=3)=\left(\tfrac56\right)^2\tfrac16=\tfrac{25}{216}\approx0.116.

P(X>3)=(56)3=125216≈0.579P(X>3)=\left(\tfrac56\right)^3=\tfrac{125}{216}\approx0.579.

E[X]=1p=6E[X]=\tfrac1p=6 rolls.

Try it yourself

A shooter hits a target with probability 0.2 each try. What is the probability the first hit comes on the 4th try?

Show the answer

(0.8)3(0.2)=0.512×0.2=0.1024(0.8)^3(0.2)=0.512\times0.2=0.1024.

Keep going with practice

The geometric distribution sits next to the binomial and Poisson in Vidi's interactive distribution plot.