Tutorials › Statistical Theory I - Probability and Distribution Theory › Geometric Means, Variances, and Tail Probabilities

Geometric and Count Distributions · Tutorial 127 of 994

Geometric Means, Variances, and Tail Probabilities

Learn how the two geometric conventions relate, how to derive their moments, and how to calculate waiting-time tail probabilities without off-by-one errors.

Beginner 9 min read

What You'll Learn

  • Distinguish failures before the first success from trials through the first success
  • Derive the mean and variance for each geometric convention
  • Use the one-unit shift to compare the two means and variances
  • Calculate survival probabilities and cumulative probabilities at integer thresholds
  • Avoid common off-by-one errors when translating waiting-time events

Two Ways to Count the Same Wait

A geometric random variable describes how long a sequence of independent trials continues until the first success. The numerical answer depends on what is counted: the failures before that success, or all the trials up to and including it. These are two measurements of the same wait, but their means differ by one. Their variances and appropriately translated tail probabilities agree.

Suppose each trial succeeds with probability \(p\), where \(0<p<1\), and write \(q=1-p\) for the failure probability. The trials are independent and have the same success probability. The probability mass functions below follow by requiring an initial sequence of failures and then a success.

Definition: Let \(X\) be the number of failures before the first success, so \(X\) has support \(0,1,2,\ldots\) and \(P(X=k)=q^k p\). Let \(Y\) be the number of trials through and including the first success, so \(Y\) has support \(1,2,3,\ldots\) and \(P(Y=k)=q^{k-1}p\). On the same sequence of trials, \(Y=X+1\).

The shift \(Y=X+1\) is the key to comparing the two conventions. We will also derive the moments directly, because the calculations make clear where the variance comes from.

Means and Variances

The geometric series and its derivatives give the sums needed for the moments. For \(0<q<1\), the power series \(\sum_{k=0}^{\infty}q^k=1/(1-q)\) can be differentiated term by term inside its radius of convergence. Differentiating once and then differentiating again yields

$$ \sum_{k=1}^{\infty} kq^{k-1}=\frac{1}{(1-q)^2}, \qquad \sum_{k=1}^{\infty} k^2q^{k-1}=\frac{1+q}{(1-q)^3}. $$

For the second identity, the first differentiation gives \(\sum_{k=1}^{\infty}kq^{k-1}=(1-q)^{-2}\). Differentiating that identity gives \(\sum_{k=2}^{\infty}k(k-1)q^{k-2}=2(1-q)^{-3}\). Multiplying by \(q\) and adding the first identity gives the displayed sum of \(k^2q^{k-1}\).

Theorem: For \(X\), the number of failures before the first success, \(E[X]=q/p\) and \(\operatorname{Var}(X)=q/p^2\). For \(Y\), the number of trials through the first success, \(E[Y]=1/p\) and \(\operatorname{Var}(Y)=q/p^2\).

Proof. Since \(1-q=p\), the first series identity gives

$$ E[X]=\sum_{k=0}^{\infty}kq^kp =pq\sum_{k=1}^{\infty}kq^{k-1} =\frac{pq}{(1-q)^2} =\frac{q}{p}. $$

Similarly, the second identity gives the second raw moment:

$$ E[X^2]=\sum_{k=0}^{\infty}k^2q^kp =pq\sum_{k=1}^{\infty}k^2q^{k-1} =\frac{pq(1+q)}{(1-q)^3} =\frac{q(1+q)}{p^2}. $$

Therefore,

$$ \operatorname{Var}(X) =E[X^2]-(E[X])^2 =\frac{q(1+q)}{p^2}-\frac{q^2}{p^2} =\frac{q}{p^2}. $$

Because \(Y=X+1\), linearity of expectation gives \(E[Y]=E[X]+1=q/p+1=1/p\), using \(p+q=1\). Adding a constant does not change variance, so \(\operatorname{Var}(Y)=\operatorname{Var}(X)=q/p^2\). This also proves the stated formulas for \(Y\). \(\square\)

The mean counts include the difference in convention: the trials-through-success mean is exactly one larger. The variance describes spread around the mean, and shifting every possible value by one leaves that spread unchanged.

Worked Example: Comparing Means and Variances

A trial succeeds with probability \(p=0.25\), so \(q=0.75\). Find the means and variances under both conventions.

For failures before the first success,

$$ E[X]=\frac{q}{p}=\frac{0.75}{0.25}=3, \qquad \operatorname{Var}(X)=\frac{q}{p^2} =\frac{0.75}{(0.25)^2}=12. $$

For trials through the first success,

$$ E[Y]=\frac{1}{p}=\frac{1}{0.25}=4, \qquad \operatorname{Var}(Y)=\frac{q}{p^2}=12. $$

The results agree with \(Y=X+1\): the mean increases by one, while the variance stays at 12. The standard deviation in either convention is \(\sqrt{12}\), approximately \(3.46\).

Survival Probabilities and Integer Thresholds

A survival probability is the probability that a waiting time reaches or exceeds a specified threshold. For a discrete variable, it is important to distinguish “at least \(k\)” from “more than \(k\).” Summing the mass function gives concise formulas for both conventions.

Theorem: For any integer \(k\geq 0\), \(P(X\geq k)=q^k\). For any integer \(m\geq 0\), \(P(Y>m)=q^m\) and \(P(Y\leq m)=1-q^m\). Equivalently, for an integer \(r\geq 1\), \(P(Y\geq r)=q^{r-1}\).

Proof. For \(k\geq0\), the event \(X\geq k\) means that the first \(k\) trials all fail. Summing the mass function confirms the same result:

$$ P(X\geq k) =\sum_{j=k}^{\infty}pq^j =pq^k\sum_{\ell=0}^{\infty}q^\ell =pq^k\frac{1}{1-q} =q^k. $$

For \(m\geq0\), \(Y>m\) means the first \(m\) trials all fail. Equivalently, since \(Y=X+1\), it is the event \(X\geq m\). Thus \(P(Y>m)=q^m\), and taking the complement gives \(P(Y\leq m)=1-q^m\). Finally, \(Y\geq r\) is the same event as \(Y>r-1\), so \(P(Y\geq r)=q^{r-1}\). \(\square\)

These formulas pair naturally: \(P(X\geq k)=P(Y>k)=q^k\). The events match because \(Y=X+1\), not because the two variables use the same threshold and inequality.

Worked Example: “At Least” Versus “More Than”

Let \(p=0.4\), so \(q=0.6\). Find the probability of at least three failures before the first success, and compare it with the probability that the success takes more than three trials.

For \(X\), at least three failures means \(X\geq3\). For \(Y\), more than three trials means \(Y>3\). Both events require the first three trials to fail:

$$ P(X\geq3)=q^3=(0.6)^3=0.216, \qquad P(Y>3)=q^3=0.216. $$

By contrast, at least three trials means \(Y\geq3\). Only the first two trials must fail, because a success on trial 3 is included:

$$ P(Y\geq3)=q^2=(0.6)^2=0.36. $$

The distinction between \(Y>3\) and \(Y\geq3\) changes the exponent from 3 to 2 and the probability from 0.216 to 0.36.

Worked Example: Choosing a Trial Limit for a Success Probability

A procedure succeeds on each independent attempt with probability \(p=0.2\). What is the smallest number \(m\) of trials that gives at least a 90% chance of seeing a success?

Here \(q=0.8\). The chance of at least one success within \(m\) trials is \(P(Y\leq m)=1-q^m\). We need

$$ 1-(0.8)^m\geq0.90 \quad\Longleftrightarrow\quad (0.8)^m\leq0.10. $$

Taking logarithms, and noting that \(\log(0.8)<0\), reverses the inequality when dividing:

$$ m\geq\frac{\log(0.10)}{\log(0.8)} \approx10.32. $$

Since \(m\) must be an integer, the smallest candidate is 11. Check the adjacent integers:

$$ P(Y\leq10)=1-(0.8)^{10}\approx0.8926<0.90, \qquad P(Y\leq11)=1-(0.8)^{11}\approx0.9141\geq0.90. $$

Thus 11 trials are necessary and sufficient. The calculation uses the trials-through-success convention because the question asks how many attempts are allowed.

Common Pitfall and Interpretation

A frequent error is to use \(q^k\) for \(P(Y\geq k)\). That exponent is one too large for this event: \(Y\geq k\) allows success on trial \(k\), so only the first \(k-1\) trials are required to be failures. The correct expression is \(P(Y\geq k)=q^{k-1}\). In contrast, \(P(Y>k)=q^k\), because success must not occur on any of the first \(k\) trials.

A related mistake is to add one to the variance when changing conventions. The identity \(Y=X+1\) increases the mean by one but does not increase the variance. The same shift also helps translate events: \(X\geq k\) and \(Y>k\) describe the same waiting outcomes, while \(Y\geq k\) corresponds to \(X\geq k-1\).

Means summarize the typical wait, and survival probabilities answer questions about unusually long waits or required trial limits. Both are useful in planning repeated procedures: an expected wait alone does not tell you the probability of exceeding a particular deadline. The geometric formulas provide that probability directly once the success chance and counting convention are clear.

Key takeaway: For \(X\), failures before success, the mean is \(q/p\); for \(Y\), trials through success, it is \(1/p\). Both variances are \(q/p^2\). For integer thresholds, \(P(X\geq k)=q^k\) and \(P(Y>m)=q^m\).

Check Your Understanding

Use \(q=1-p\), and keep the two counting conventions distinct.

  1. If \(p=0.3\), calculate the mean and variance of both the number of failures before the first success and the number of trials through the first success.
  2. For \(p=0.2\), find \(P(X\geq4)\) and \(P(Y>4)\). Why are these probabilities equal?
  3. For \(p=0.5\), calculate \(P(Y\geq3)\) and \(P(Y>3)\). Explain why they differ.
  4. Suppose the mean number of trials through the first success is 5. Find \(p\), then find the variance under either convention.
  5. Explain why adding one to a geometric random variable increases its mean but leaves its variance unchanged.