Expected Value of a Geometric Distribution by First-Step Analysis
At a glance
- 1. Define the count
Let X count the trials up to and including the first success, with success probability p on each independent trial.
- 2. Condition on trial one
A success ends the wait at one trial; a failure costs one trial and leaves a fresh wait with the same expected length.
- 3. Solve the equation
Set E[X] = p + (1 − p)(1 + E[X]) and rearrange to obtain E[X] = 1/p.
- 4. Check the convention
If you count failures before the first success instead, the mean is (1 − p)/p.
A geometric random variable models the number of repeated independent trials needed to get the first success. First-step analysis finds its expected value by separating the possibilities on the very first trial: either you succeed immediately, or you spend one trial and then face the same waiting-time problem again.
The result depends on what the random variable counts. This article first uses the common convention that counts the successful trial, then gives the alternative convention that counts only failures.
Define the geometric random variable
Suppose each trial succeeds with probability , where , and trials are independent. Let be the number of trials up to and including the first success. Then can take the values .
Write for the probability of failure. The goal is to find using the outcome of the first trial, rather than summing the full probability distribution.
Apply first-step analysis
There are two cases:
- With probability , the first trial succeeds. You have used one trial, so .
- With probability , the first trial fails. You have used one trial, and the remaining wait has the same distribution as : the future trials are independent and have the same success probability.
Let denote the number of additional trials after the first failure. It has the same expected value as . In the failure case, the total number of trials is . Conditioning on the first outcome gives
Now solve for the expectation:
The second line uses , and the third uses . Thus, the expected number of trials through the first success is .
Worked example: a 20% success chance
Suppose each attempt succeeds with probability . The first-step equation is
Expanding and rearranging gives , so and . On average, you need five attempts, counting the successful attempt. This is an average over many repetitions; it does not mean that success is guaranteed by the fifth attempt.
As a check, the probability of still waiting after trials is . The tail-sum formula for a positive integer-valued random variable gives , agreeing with the first-step calculation.
If you count failures instead
Some texts define a geometric random variable as the number of failures before the first success. Then takes values , and . Its first-step equation is
because immediate success means zero failures, while an initial failure contributes one and starts a fresh wait. Solving gives . For the 20% example, the expected number of failures is ; adding the successful trial gives five total trials.
Common mistakes
- Mixing up the two conventions. A mean of corresponds to counting trials through success. A mean of corresponds to counting failures before success.
- Forgetting the first failed trial. After a failure, the total is one trial plus a new waiting time—not just a new waiting time.
- Treating the expectation as a guarantee. The mean does not specify how many trials a particular run will take, nor does it give the probability of success by a particular trial.
- Using the formula when the assumptions fail. The result requires a constant success probability and independent trials. If probabilities change from trial to trial or outcomes are dependent, the remaining wait after a failure need not have the same distribution.
For , success occurs immediately and , as the formula predicts. If , success never occurs, so there is no finite expected waiting time.
References
- A First Course in Probability, by Sheldon M. Ross
Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.