Why Derive the Geometric Mean and Variance?
A geometric model describes a wait measured in repeated trials: how many attempts are needed until the first success? The model's probability mass function gives the probability of each possible wait. From it, we can derive the distribution's average waiting time and its variability, rather than treating those formulas as rules to memorize.
The convention matters. In this tutorial, the random variable counts trials through and including the first success. Thus its possible values are \(1,2,3,\ldots\), not \(0,1,2,\ldots\). Changing that convention changes the mean, so it must be made explicit before calculating.
Model and Probability Mass Function
Write \(q=1-p\) for the probability of failure on any one trial. For the first success to occur on trial \(k\), the first \(k-1\) trials must all be failures and trial \(k\) must be a success. Independence gives the product \(q^{k-1}p\). In particular, \(P(X=1)=p\), and \(P(X=2)=qp\).
The assumptions are substantive: success and failure must be defined for each trial; the success probability must remain \(p\); and outcomes on different trials must be independent. If those conditions do not reasonably describe the process, the geometric formulas need not apply. When \(p=1\), success occurs on the first trial with certainty. The derivations below use \(0<p<1\), and the formulas also hold for \(p=1\) by direct evaluation.
Deriving the Mean
For a discrete random variable, its expected value is the probability-weighted sum of its possible values. Applying that definition to \(X\) gives
To evaluate this sum, start with the geometric series. For \(0\leq q<1\), its sum is \(1/(1-q)\). Differentiating both sides with respect to \(q\) gives the series of terms needed for the mean:
This term-by-term differentiation is valid for a power series inside its interval of convergence, here \(|q|<1\). Since \(1-q=p\), substitution into the expectation yields the mean:
Deriving the Variance
The variance measures the probability-weighted squared distance from the mean. A useful way to calculate it is first to find the second moment \(E[X^2]\), then use \(\operatorname{Var}(X)=E[X^2]-(E[X])^2\). The second moment from the probability mass function is
For the required sum, first differentiate the geometric series once, then multiply by \(q\). Differentiating that resulting identity once more gives:
The last equality follows by differentiating \(q(1-q)^{-2}\): its derivative is \((1-q)^{-2}+2q(1-q)^{-3}=(1+q)(1-q)^{-3}\). As before, the power-series operations are valid for \(0\leq q<1\). Therefore,
To see why subtracting the squared mean gives the variance, expand the squared distance: \(E[(X-\mu_X)^2]=E[X^2-2\mu_XX+\mu_X^2]=E[X^2]-2\mu_XE[X]+\mu_X^2=E[X^2]-\mu_X^2\), because \(E[X]=\mu_X\). Now substitute the moments and \(q=1-p\):
Variance is measured in squared trials because it averages squared differences in the number of trials. The standard deviation, its square root, is in trials, like \(X\) and its mean. When \(p=1\), \(X=1\) with certainty, so its mean is \(1\) and its variance is \(0\), agreeing with both formulas.
Worked Applications
Worked Example: A Success Probability of 0.25
Suppose, hypothetically, that an independent trial has a 0.25 probability of success each time, and a process repeats trials until its first success. Find the mean, variance, and standard deviation of the number of trials. The constant probability and independence conditions are assumed to hold.
Here \(p=0.25\), so \(1-p=0.75\). Applying the derived mean formula,
The variance and standard deviation are
Under this model, the long-run average number of trials through success is 4. The standard deviation describes the distribution's spread around that mean; it does not mean every wait is close to 4 trials.
Worked Example: A High Probability of Success
Imagine a hypothetical process in which each independent trial succeeds with probability \(p=0.60\). Let \(X\) count trials through the first success. Find its mean and variance. The calculation is appropriate provided each trial has the same 0.60 success probability and trials are independent.
The mean is
The variance is
Thus the standard deviation is \(\sqrt{1.111\ldots}\approx 1.054\) trials. The mean need not be a possible observed value: an individual wait is a whole number of trials, while an average across many waits can be non-integer.
Worked Example: A Low Probability of Success
Suppose, hypothetically, that independent attempts each have success probability \(p=0.10\), and attempts continue until the first success. Find the mean and variance of the number of attempts. We assume the success chance remains 0.10 on every attempt, as required by the model.
Using the mean formula,
Using \(1-p=0.90\), the variance is
The standard deviation is \(\sqrt{90}\approx 9.487\) attempts. Compared with a higher success probability, this model has both a larger mean wait and greater variability in the waiting time.
Interpreting the Results and Avoiding a Common Mistake
The formulas describe features of a probability distribution, not a promise about an individual sequence of trials. For example, a mean of 10 attempts does not say that success will occur on attempt 10, nor that each set of 10 attempts must contain a success. The variance quantifies spread in squared units; to describe spread in the original units, use the standard deviation.
A common error is to use a version of the geometric distribution that counts failures before the first success while applying the trials-through-success formula. If the variable counts trials through success, its support starts at 1 and its mean is \(1/p\). A variable counting failures before success instead has support starting at 0 and is one less than the trials-through-success count. Mixing these definitions shifts the mean by one trial. Always define what \(X\) counts before using a formula.
The derivation also shows why both formulas depend on the model assumptions. The sums used the geometric probability mass function, which came from independent trials with a fixed success probability. If success probabilities change from trial to trial, or outcomes are dependent, the probabilities \(q^{k-1}p\) may no longer describe the waiting time, and these derived moments may not apply.
Check Your Understanding
Use the trials-through-success convention and show the main substitutions in your calculations.
- State the support and probability mass function of \(X\) when each independent trial succeeds with probability \(p\).
- In one sentence, explain why \(P(X=k)=(1-p)^{k-1}p\).
- If \(p=0.20\), find the mean and variance of \(X\), including their units.
- What geometric-series identity is used to derive \(E[X]\), and what condition on \(q=1-p\) makes the series valid?
- Explain why a variance of 12 trials squared has standard deviation \(\sqrt{12}\) trials, rather than 12 trials.
- What changes if a waiting-time variable counts failures before the first success instead of trials through and including it?