Skip to main content
Examonaut

Topic 3 · Lesson 1 of 3

The geometric distribution

Probabilities

Let XX be the number of trials up to and including the first success. X=xX = x means x−1x - 1 failures followed by a success, so

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

We write X∼Geo(p)X \sim \text{Geo}(p). The smallest value is 1, and there is no largest value. Each probability is (1−p)(1 - p) times the one before, so P(X=1)=p\text{P}(X = 1) = p is always the largest: the most likely waiting time is one trial.

Cumulative probabilities

X>xX > x means the first xx trials are all failures, so

P(X>x)=(1−p)xP(X⩽x)=1−(1−p)x\text{P}(X > x) = (1 - p)^x \qquad \text{P}(X \leqslant x) = 1 - (1 - p)^x

These save adding up long lists of terms. Be careful with the boundaries: P(X⩾x)=P(X>x−1)=(1−p)x−1\text{P}(X \geqslant x) = \text{P}(X > x - 1) = (1 - p)^{x - 1}.

For example, if a fair dice is rolled until a 1 or a 2 appears (p=13p = \frac{1}{3}):

  • the first success is on the third roll with probability (23)2×13=427\left(\frac{2}{3}\right)^2 \times \frac{1}{3} = \frac{4}{27};
  • more than 4 rolls are needed with probability (23)4=1681=0.1975\left(\frac{2}{3}\right)^4 = \frac{16}{81} = 0.1975;
  • 8 or more rolls are needed with probability (23)7=0.0585\left(\frac{2}{3}\right)^7 = 0.0585.

Mean and variance

If X∼Geo(p)X \sim \text{Geo}(p) then

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

The mean makes sense: if one trial in five is a success, you wait five trials on average. The variance is large: for p=0.04p = 0.04 the mean is 25 but the standard deviation is 0.960.04=24.5\frac{\sqrt{0.96}}{0.04} = 24.5, so waiting times vary a great deal.

The mean can be proved from the definition: E(X)=∑x=1∞xpqx−1=p(1−q)2=1p\text{E}(X) = \sum_{x=1}^{\infty} xpq^{x-1} = \frac{p}{(1 - q)^2} = \frac{1}{p}, using ∑xqx−1=(1−q)−2\sum x q^{x-1} = (1 - q)^{-2} with q=1−pq = 1 - p. Probability generating functions give a neater proof.

Worked example

How many to test?

8% of people carry a particular gene. Find the smallest number of people that must be tested for the probability of finding at least one carrier to exceed 0.9.

Show solution
  1. P(X⩽n)=1−0.92n>0.9\text{P}(X \leqslant n) = 1 - 0.92^n > 0.9, so 0.92n<0.10.92^n < 0.1.
  2. Take logarithms: nln⁡0.92<ln⁡0.1n \ln 0.92 < \ln 0.1. Dividing by the negative number ln⁡0.92\ln 0.92 reverses the inequality: n>ln⁡0.1ln⁡0.92=27.6n > \frac{\ln 0.1}{\ln 0.92} = 27.6.
  3. So n=28n = 28.

No memory

The geometric distribution "forgets" the past:

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

If the first mm trials have all failed, the number of further trials needed has the same distribution as at the start. A dice that has not shown a 6 in five rolls is not "due" one.

Worked example

Taking turns

Cara and Dev take turns to toss a fair coin, Cara first, and the first to get a head wins. Cara wins on toss 1, 3, 5, ... so

Show solution
P(Cara wins)=12+(12)212+(12)412+⋯=121−14=23\text{P}(\text{Cara wins}) = \frac{1}{2} + \left(\frac{1}{2}\right)^2\frac{1}{2} + \left(\frac{1}{2}\right)^4\frac{1}{2} + \cdots = \frac{\frac{1}{2}}{1 - \frac{1}{4}} = \frac{2}{3}

a geometric series with ratio 14\frac{1}{4}. Going first is a big advantage. The total number of tosses is Geo(12)\text{Geo}\left(\frac{1}{2}\right), with mean 2.

Finding the parameter

If P(X=2)=0.21\text{P}(X = 2) = 0.21 then p(1−p)=0.21p(1 - p) = 0.21, giving p=0.3p = 0.3 or p=0.7p = 0.7. Extra information decides between them: if also P(X>1)>0.5\text{P}(X > 1) > 0.5, then 1−p>0.51 - p > 0.5, so p=0.3p = 0.3. If you are given the mean, p=1E(X)p = \frac{1}{\text{E}(X)}.

Practise this topic

Both are part of Premium.