Why the Counting Convention Matters
A geometric random variable describes how long it takes to obtain the first success in repeated trials. Its mean and variance are determined by the success probability, but the numerical value of the mean depends on what is counted: the successful trial itself, or only the failures before it. This distinction matters whenever a waiting-time answer is reported in applications such as repeated inspections, claim reviews, or tests for a specified event.
The formulas in this tutorial assume that trials are independent and that every trial has the same probability of success. The geometric model is therefore appropriate only when the success probability remains fixed from trial to trial and the trials do not affect one another. The results are aligned with the SOA VEE Mathematical Statistics syllabus.
The factor \(q^{t-1}\) in the trials-count mass function represents the \(t-1\) failures followed by a success. For the failures-count variable, \(f\) failures followed by a success have probability \(q^fp\). These mass functions use different supports, so the same verbal description can lead to different numerical means if the count is not identified first.
Deriving the Mean and Variance
The derivation uses geometric-series identities. For \(0<q<1\), start with \(\sum_{k=0}^{\infty}q^k=1/(1-q)\). Differentiating this series and then differentiating \(q\) times its first derivative gives the two sums needed for the second moments:
Because \(1-q=p\), these identities can be applied directly to the probability mass functions. The following calculation also shows why the variance formula has \(p^2\) in its denominator.
Use the definition of expectation and the first series identity: \(E[T]=\sum_{t=1}^{\infty}tq^{t-1}p=p/(1-q)^2=1/p\).
Using the second identity, \(E[T^2]=\sum_{t=1}^{\infty}t^2q^{t-1}p=p(1+q)/(1-q)^3=(1+q)/p^2\).
\(\operatorname{Var}(T)=E[T^2]-(E[T])^2=(1+q)/p^2-1/p^2=q/p^2\).
For \(F\), its probability mass function starts at zero. The required series are \(\sum_{f=0}^{\infty}fq^f=q/(1-q)^2\) and \(\sum_{f=0}^{\infty}f^2q^f=q(1+q)/(1-q)^3\). Multiplying each sum by \(p\) gives the first and second moments of \(F\).
Therefore, subtracting \((E[F])^2=q^2/p^2\) gives \(\operatorname{Var}(F)=q(1+q)/p^2-q^2/p^2=q/p^2\). This agrees with \(T=F+1\): adding a constant increases the mean by that constant but does not change the variance.
The restriction \(0<p<1\) is important. If \(p=1\), success occurs on the first trial with certainty, so \(T=1\), \(F=0\), and both variances are zero. If \(p=0\), a success never occurs, so there is no finite geometric waiting time and the displayed finite-mean formulas do not apply.
Worked Calculations
Worked Example: Expected Number of Weekly Screening Trials
Hypothetical scenario. A screening procedure is repeated weekly until it detects a specified marker. Assume each weekly result is independent, the probability of detection is \(p=0.25\) each week, and this probability remains constant. Let \(T\) count the week of the first detection, including the detection week. Find its mean and variance.
Method. This is a trials-count geometric variable. The failure probability is \(q=1-p=1-0.25=0.75\), and the support is \(1,2,3,\ldots\).
The expected number of weekly trials is \(E[T]=1/p=1/0.25=4\). The variance, in squared weeks, is \(\operatorname{Var}(T)=q/p^2=0.75/(0.25)^2=0.75/0.0625=12\).
Thus the mean waiting time is 4 weekly trials and the variance is 12 trials squared. As a check on the convention, a mean of 4 trials includes the successful week; the expected number of failed weeks before detection is \(4-1=3\). The common mistake this avoids is reporting 3 as the expected number of trials.
Worked Example: Failures Before a Successful Transaction
Hypothetical scenario. A processing team handles independent transactions. Each transaction has probability \(p=0.40\) of passing a specified check, and the probability stays fixed. Let \(F\) be the number of failed transactions before the first pass. Find \(E[F]\), \(\operatorname{Var}(F)\), and the expected total number of transactions through the first pass.
Method. The problem counts failures before success, so use the failures-count convention. First, \(q=1-0.40=0.60\).
The expected number of failures is \(E[F]=q/p=0.60/0.40=1.5\). The variance of the failure count is \(\operatorname{Var}(F)=q/p^2=0.60/(0.40)^2=0.60/0.16=3.75\).
The total number of transactions includes the successful one. Since \(T=F+1\), its expected value is \(E[T]=E[F]+1=1.5+1=2.5\) transactions.
The results are consistent with the trials-count formula: \(1/p=1/0.40=2.5\). The variance remains \(3.75\) because adding one to a random variable does not change its variance. A common mistake is to use \(1/p\) as the mean of \(F\); that counts the successful transaction as well.
Worked Example: Reconciling Both Counts in an Inspection Model
Hypothetical scenario. An item is inspected repeatedly until the first inspection that detects a defect. Assume independent inspections and a constant detection probability \(p=0.20\) per inspection. Let \(F\) count the inspections that fail to detect the defect before the first detection, and let \(T\) count all inspections through detection. Find the mean and variance under both counts, then check the probability that exactly three inspections fail before detection.
Method. The failure probability is \(q=1-0.20=0.80\). Start with \(F\), since the question explicitly counts failures before the successful inspection.
For failures, \(E[F]=q/p=0.80/0.20=4\), and \(\operatorname{Var}(F)=q/p^2=0.80/(0.20)^2=0.80/0.04=20\). For total inspections, \(T=F+1\), so \(E[T]=4+1=5\), while \(\operatorname{Var}(T)=20\).
Exactly three failures before detection means three failures followed by a detection. Its probability is \(P(F=3)=q^3p=(0.80)^3(0.20)=0.512(0.20)=0.1024\). Equivalently, this is \(P(T=4)=q^{4-1}p=0.1024\), since three failures mean detection on the fourth inspection.
The check confirms that the two counts describe the same waiting process, shifted by one. The common mistake this avoids is treating three failures as detection on inspection three; the successful inspection is the next one.
Reading the Formulas Correctly
The expected count answers a long-run average question, not a guarantee about any one waiting time. For example, \(E[T]=4\) does not mean that success must occur by trial four, and it does not mean that the probability of success on trial four is especially large. It summarizes the average across repeated independent waiting processes governed by the same \(p\).
The variance measures dispersion around the appropriate mean. Both conventions have the same variance because their random variables differ only by one. Their standard deviation is therefore also the same, \(\sqrt{q}/p\). The mean, by contrast, must match the stated count.
| Quantity | Trials through first success \(T\) | Failures before first success \(F\) |
|---|---|---|
| Support | 1, 2, 3, ... | 0, 1, 2, ... |
| Probability mass function | \(P(T=t)=q^{t-1}p\) | \(P(F=f)=q^fp\) |
| Mean | \(1/p\) | \(q/p\) |
| Variance | \(q/p^2\) | \(q/p^2\) |
A reliable calculation starts by translating the wording into a support: does the count begin at one and include the success, or does it begin at zero and count only failures? Then identify \(p\), calculate \(q=1-p\), and apply the matching mean with the common variance formula. This sequence prevents an indexing error before any arithmetic is done.
Common Mistake: Confusing a Mean With a Variance
Suppose the number of failures before success is geometric with \(p=0.40\), so \(q=0.60\). A tempting but incorrect calculation is \(\operatorname{Var}(F)=q/p=0.60/0.40=1.5\). That expression is actually the mean \(E[F]\), not the variance.
The correct variance formula has \(p^2\) in the denominator: \(\operatorname{Var}(F)=q/p^2=0.60/(0.40)^2=0.60/0.16=3.75\). The mean of 1.5 failures and variance of 3.75 failures squared are different summaries and have different units. A second frequent error is to use \(1/p\) for the failure count: \(1/p\) is the mean number of trials including success, while \(q/p\) is the mean number of failures before success.
Check Your Understanding
For each problem, identify the counting convention before calculating. Assume independent trials with a fixed success probability unless the problem states otherwise.
- A hypothetical sensor has probability \(0.20\) of detecting a signal on each independent scan. Let \(T\) be the number of scans through the first detection. Find \(E[T]\) and \(\operatorname{Var}(T)\). (Answer: \(E[T]=5\), \(\operatorname{Var}(T)=20\).)
- A laboratory repeats an independent calibration check with pass probability \(0.60\). Let \(F\) count failed checks before the first pass. Find the mean and variance of \(F\). (Answer: \(E[F]=2/3\approx0.6667\), \(\operatorname{Var}(F]=10/9\approx1.1111\).)
- A hypothetical review has probability \(0.25\) of resolving a case at each independent attempt. Find the mean number of attempts through resolution, the mean number of unsuccessful attempts before resolution, and the variance under either count. (Answer: the means are 4 attempts and 3 unsuccessful attempts; either variance is 12.)
- An inspection process has a constant independent detection probability of \(0.10\). Find the expected number of inspections before and including detection, the expected number of missed detections before it, and the variance of either count. (Answer: the means are 10 inspections and 9 missed detections; either variance is 90.)
- A trials-count geometric waiting time has mean 8. Determine \(p\), \(q\), its variance, and the mean failures count for the same process. (Answer: \(p=0.125\), \(q=0.875\), variance \(=56\), and mean failures count \(=7\).)