St · Statistics & Probability

Expected Value of a Geometric Distribution by First-Step Analysis

Updated 13 October 2026

At a glance

  1. 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. 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. 3. Solve the equation

    Set E[X] = p + (1 − p)(1 + E[X]) and rearrange to obtain E[X] = 1/p.

  4. 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 pp, where 0<p≤10 < p \leq 1, and trials are independent. Let XX be the number of trials up to and including the first success. Then XX can take the values 1,2,3,…1, 2, 3, \ldots.

Write q=1−pq = 1-p for the probability of failure. The goal is to find E[X]E[X] using the outcome of the first trial, rather than summing the full probability distribution.

Apply first-step analysis

There are two cases:

  • With probability pp, the first trial succeeds. You have used one trial, so X=1X=1.
  • With probability qq, the first trial fails. You have used one trial, and the remaining wait has the same distribution as XX: the future trials are independent and have the same success probability.

Let X′X' denote the number of additional trials after the first failure. It has the same expected value as XX. In the failure case, the total number of trials is 1+X′1+X'. Conditioning on the first outcome gives

E[X]=p(1)+q(1+E[X]).E[X] = p(1) + q(1 + E[X]).

Now solve for the expectation:

E[X]=p+q+qE[X]E[X]=1+qE[X]pE[X]=1E[X]=1p.\begin{aligned} E[X] &= p + q + qE[X] \\ E[X] &= 1 + qE[X] \\ pE[X] &= 1 \\ E[X] &= \frac{1}{p}. \end{aligned}

The second line uses p+q=1p+q=1, and the third uses 1−q=p1-q=p. Thus, the expected number of trials through the first success is 1/p1/p.

Worked example: a 20% success chance

Suppose each attempt succeeds with probability p=0.2p=0.2. The first-step equation is

E[X]=0.2(1)+0.8(1+E[X]).E[X] = 0.2(1) + 0.8(1+E[X]).

Expanding and rearranging gives E[X]=0.2+0.8+0.8E[X]E[X]=0.2+0.8+0.8E[X], so 0.2E[X]=10.2E[X]=1 and E[X]=5E[X]=5. 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 kk trials is qkq^k. The tail-sum formula for a positive integer-valued random variable gives E[X]=∑k=0∞P(X>k)=∑k=0∞qk=1/(1−q)=1/pE[X]=\sum_{k=0}^{\infty}P(X>k)=\sum_{k=0}^{\infty}q^k=1/(1-q)=1/p, agreeing with the first-step calculation.

If you count failures instead

Some texts define a geometric random variable YY as the number of failures before the first success. Then YY takes values 0,1,2,…0,1,2,\ldots, and X=Y+1X=Y+1. Its first-step equation is

E[Y]=p(0)+q(1+E[Y]),E[Y] = p(0) + q(1+E[Y]),

because immediate success means zero failures, while an initial failure contributes one and starts a fresh wait. Solving gives E[Y]=q/p=(1−p)/pE[Y]=q/p=(1-p)/p. For the 20% example, the expected number of failures is 0.8/0.2=40.8/0.2=4; adding the successful trial gives five total trials.

Common mistakes

  • Mixing up the two conventions. A mean of 1/p1/p corresponds to counting trials through success. A mean of (1−p)/p(1-p)/p 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 p=1p=1, success occurs immediately and E[X]=1E[X]=1, as the formula predicts. If p=0p=0, success never occurs, so there is no finite expected waiting time.

References

  1. 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.