Uni-Sine
MathematicsStatistics

The geometric distribution

The geometric distribution models how many trials it takes to get the first success, when each trial is independent and has the same probability of success, p. If X is the number of the trial on which the first success happens, then P(X = x) = (1 − p)ˣ⁻¹p for x = 1, 2, 3, ..., and the mean number of trials is 1/p.

What is a geometric distribution?

Keep repeating a yes-or-no trial until you get a success: rolling a dice until a six, testing items until you find a faulty one, taking driving tests until you pass. The number of trials this takes is random, and it follows a geometric distribution when:

  • Each trial has two outcomes, success or failure.
  • The trials are independent.
  • The probability of success, p, is the same every time.
  • You count the trials up to and including the first success.

Unlike the binomial distribution, there is no fixed number of trials. X can be 1, 2, 3 and so on with no upper limit. We write X ~ Geo(p).

0510152025301234567
Geo(0.3): the probability that the first success is on trial 1, 2, 3, ... (as a percentage)

The bar chart shows X ~ Geo(0.3). The most likely value is always 1, and each bar is (1 − p) times the one before, so the probabilities fall away steadily. That shrinking by the same factor each time is a geometric sequence, which is where the name comes from.

The geometric distribution formula

P(X = x) = (1 - p)^{x - 1}\ p \qquad x = 1, 2, 3, ...

For the first success to be on trial x, the first x − 1 trials must all be failures, each with probability 1 − p, and then trial x must be a success, with probability p. The trials are independent, so multiply.

Example 1: the first faulty item

4% of the items from a machine are faulty, independently. An inspector tests items one at a time until a faulty one turns up. Find the probability that the first faulty item is the 10th tested.

X ~ Geo(0.04), so P(X = 10) = 0.96⁹ × 0.04 = 0.0277.

Cumulative geometric probabilities

"More than x trials" means the first x trials were all failures, which gives two neat results:

P(X > x) = (1 - p)^x \qquad P(X \leq x) = 1 - (1 - p)^x

Example 2: more than and at most

For the inspector in Example 1:

  • P(more than 20 items are needed) = P(X > 20) = 0.96²⁰ = 0.442.
  • P(a faulty item within the first 5) = P(X ≤ 5) = 1 − 0.96⁵ = 0.185.

Example 3: finding p

For X ~ Geo(p), P(X > 3) = 0.343. Find p. P(X > 3) = (1 − p)³ = 0.343, so 1 − p = ∛0.343 = 0.7 and p = 0.3.

Check your understanding.

practice
Pick an answer, then check it.
A fair dice is rolled until a six appears. What is the probability that the first six is on the 4th roll?

Mean and variance of a geometric distribution

E(X) = \frac{1}{p} \qquad \text{Var}(X) = \frac{1 - p}{p^2}

The mean makes sense: if 4% of items are faulty, you expect to test 1 ÷ 0.04 = 25 items to find the first. The variance is 0.96 ÷ 0.04² = 600, so the standard deviation is √600 ≈ 24.5. The spread is large, because sometimes you find one straight away and sometimes it takes a very long time.

Example 4: a dice

For rolling a fair dice until the first six, p = 1/6, so the mean number of rolls is 6 and the variance is (5/6) ÷ (1/36) = 30. The probability of needing more than 6 rolls is (5/6)⁶ = 0.335, so about a third of the time it takes longer than the mean.

The memoryless property

The geometric distribution "forgets" the past. If you have already had m failures, the chance of needing more than n further trials is the same as it was at the start:

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

For example, with p = 0.2, P(X > 3) = 0.8³ = 0.512. If the first 10 trials have all failed, the chance that it takes more than 3 more is still 0.512. A long run of failures doesn't make a success "due", because the trials are independent.

Geometric vs binomial distribution

Binomial, B(n, p)Geometric, Geo(p)
What X countsSuccesses in a fixed number of trialsTrials up to and including the first success
Number of trialsFixed, nNot fixed
Possible values0, 1, ..., n1, 2, 3, ... (no upper limit)
FormulaⁿCₓ pˣ(1 − p)ⁿ⁻ˣ(1 − p)ˣ⁻¹ p
Meannp1/p
Variancenp(1 − p)(1 − p)/p²

Both need independent trials with a constant probability of success. The binomial distribution guide covers the fixed-trials case.

Common mistakes

  • Using the wrong power. For the first success on trial x there are x − 1 failures, not x.
  • Using a binomial. If the number of trials isn't fixed and you stop at the first success, it is geometric.
  • Writing the mean as p. It is 1/p: a small p means a long wait.
  • Forgetting the complement. P(X ≤ x) = 1 − (1 − p)ˣ is much quicker than adding terms.
  • Thinking a success becomes more likely after many failures. Independent trials have no memory.

Practice questions

X ~ Geo(0.2).

  1. Find P(X = 3).
  2. Find P(X > 4).
  3. Find the mean and variance of X.
  4. Seeds from one packet each germinate with probability 0.7, independently. They are planted one at a time. What is the probability that the first seed to fail is the 3rd one planted?

Answers: 1) 0.8² × 0.2 = 0.128. 2) 0.8⁴ = 0.4096. 3) Mean 5, variance 0.8 ÷ 0.04 = 20. 4) A failure has probability 0.3: 0.7² × 0.3 = 0.147.

Practise with a short timed paper

The geometric distribution builds on the binomial and normal distributions from A-level Maths statistics. The daily A-level Maths: Statistics paper is a short timed paper of 8 questions on those topics, with a new one every day.

Common questions

What is a geometric distribution?
The distribution of the number of trials needed to get the first success, when trials are independent with a constant probability of success p.
What is the formula for the geometric distribution?
P(X = x) = (1 − p)ˣ⁻¹ p for x = 1, 2, 3, ...
What is the mean of a geometric distribution?
1/p. The variance is (1 − p)/p².
What is the difference between geometric and binomial distributions?
A binomial counts successes in a fixed number of trials. A geometric counts trials until the first success, with no fixed number.
What is P(X > x) for a geometric distribution?
(1 − p)ˣ, because the first x trials must all be failures.
Is the geometric distribution memoryless?
Yes. After any number of failures, the chance of needing more than n further trials is the same as at the start.

Revision cards

Say the answer first, then flip the card to check it.

Where to go next

  • Learn it

    Probability

    Distributions, expected values and the maths behind uncertainty

    Start the course
  • Test it

    A-level Maths: Statistics

    A new exam-style paper every day, with instant marking and a mark scheme

    Start today's paper
Read next
Maths · StatisticsBinomial distribution: conditions, formula, mean, varianceWhat the binomial distribution is, when to use it, its formula, mean and variance, cumulative probabilities, the normal approximation and exam questions.