Tutorials › VEE Mathematical Statistics › Geometric Quantiles and Median Waiting Times

VEE Mathematical Statistics · Geometric and Negative Binomial Models · Tutorial 108 of 880

Geometric Quantiles and Median Waiting Times

Use cumulative-probability inequalities to find geometric quantiles and medians without losing track of the support or counting convention.

Intermediate 11 min read

What You'll Learn

  • Define geometric quantiles as the smallest support value whose cumulative probability reaches the requested level.
  • Derive the quantile formula for trials until the first success.
  • Translate quantiles between trials-until-success and failures-before-success counts.
  • Find geometric medians and recognize when more than one median is possible.
  • Check answers at adjacent integers to avoid rounding and indexing errors.

Why a Geometric Quantile Needs an Integer Check

A geometric waiting time answers a deadline question: how many trials are needed before the first success has occurred with at least a specified probability? The answer is an integer, so calculating a logarithm is only part of the task. The result must be converted to the correct support value and checked against the cumulative probabilities on either side.

This matters especially for the median. The median is not generally the mean rounded to a whole number. It is determined by where the cumulative probability first reaches one-half, and it can depend on whether the waiting time counts the successful trial or only the failures before it. These quantile methods are aligned with the SOA VEE Mathematical Statistics syllabus.

Definition: Suppose independent Bernoulli trials each have the same success probability \(p\), where \(0<p<1\). Let \(T\) be the trial number of the first success, so \(T\) has support \(1,2,3,\ldots\). Its cumulative distribution function is \(F_T(n)=P(T\le n)=1-(1-p)^n\) for integer \(n\ge 1\). If \(K=T-1\) counts failures before the first success, then \(K\) has support \(0,1,2,\ldots\) and \(F_K(k)=P(K\le k)=1-(1-p)^{k+1}\) for integer \(k\ge 0\).

The constant-\(p\), independent-trial assumptions are essential: the formulas describe repeated trials with an unchanged success probability, not a process whose success chance varies from trial to trial. The probabilities at the support values follow from the complementary event: no success in the first \(n\) trials has probability \((1-p)^n\).

Definition: For a discrete random variable \(X\) with cumulative distribution function \(F_X\), its lower \(\alpha\)-quantile is the smallest support value \(q_\alpha\) for which \(F_X(q_\alpha)\ge\alpha\), where \(0<\alpha<1\). The lower median is the lower \(0.5\)-quantile. The word “smallest” is important: a quantile is not obtained by rounding to the nearest integer.

Deriving the Quantile Formula

For \(T\), the event \(T\le n\) means that at least one success has occurred among the first \(n\) trials. Its probability is one minus the probability of \(n\) consecutive failures. To reach cumulative probability \(\alpha\), find the smallest integer \(n\) satisfying \(F_T(n)\ge\alpha\).

$$ 1-(1-p)^n \ge \alpha \quad\Longleftrightarrow\quad (1-p)^n \le 1-\alpha \quad\Longleftrightarrow\quad n \ge \frac{\ln(1-\alpha)}{\ln(1-p)}. $$

The last inequality follows by taking logarithms and dividing by \(\ln(1-p)\), which is negative because \(0<1-p<1\); dividing by a negative number reverses the inequality. Thus the smallest permissible integer gives the quantile. For \(K\), the exponent in the cumulative distribution is \(k+1\), so the quantile is one less than the corresponding trial-count quantile.

$$ q_\alpha(T)=\left\lceil\frac{\ln(1-\alpha)}{\ln(1-p)}\right\rceil, \qquad q_\alpha(K)=\left\lceil\frac{\ln(1-\alpha)}{\ln(1-p)}\right\rceil-1. $$

Here \(\lceil x\rceil\) denotes the least integer greater than or equal to \(x\). The formulas apply to \(0<p<1\) and \(0<\alpha<1\). At \(p=1\), the first success occurs on trial 1 with certainty, so \(T=1\) and \(K=0\). At \(p=0\), success never occurs, and there is no finite waiting-time quantile. For \(0<p<1\), no finite support value has cumulative probability exactly 1, which is why the displayed formula is stated for \(\alpha<1\).

1
Identify the count.
Determine whether the random variable counts trials through the success, starting at 1, or failures before success, starting at 0.
2
Set the target cumulative probability.
For an \(\alpha\)-quantile, require the probability of having reached success by the proposed count to be at least \(\alpha\).
3
Solve and take the least support value.
Use the logarithm expression, then take the ceiling for \(T\); subtract one for \(K\).
4
Verify the boundary.
Check the cumulative probability at the proposed value and at the preceding support value. The first must reach the target and the second must not.

Worked Quantile and Median Calculations

Worked Example: Median and 90th Percentile of Trial Count

A hypothetical laboratory repeats an independent test until it records a positive result. Each test has probability \(p=0.20\) of a positive result. Let \(T\) count the trial on which the first positive result occurs. Find the lower median and the 90th percentile of \(T\).

Model and method. Under the stated constant-probability, independence assumptions, \(T\) is geometric on \(1,2,\ldots\) with parameter \(p=0.20\). Use the trial-count quantile formula and check the adjacent support values.

Lower median. Set \(\alpha=0.50\):

$$ \frac{\ln(1-0.50)}{\ln(1-0.20)} = \frac{\ln(0.50)}{\ln(0.80)} \approx 3.106. $$

Taking the ceiling gives \(q_{0.50}(T)=4\). Check the cumulative probabilities:

$$ F_T(3)=1-0.80^3=1-0.512=0.488, \qquad F_T(4)=1-0.80^4=1-0.4096=0.5904. $$

The cumulative probability is below \(0.50\) at 3 and at least \(0.50\) at 4, so the lower median is 4 trials.

90th percentile. Set \(\alpha=0.90\):

$$ \frac{\ln(1-0.90)}{\ln(1-0.20)} = \frac{\ln(0.10)}{\ln(0.80)} \approx 10.319. $$

The ceiling is 11. The boundary check is \(F_T(10)=1-0.80^{10}=0.8926\) and \(F_T(11)=1-0.80^{11}=0.9141\), with probabilities rounded to four decimals. Thus the 90th percentile is 11 trials. Common mistake avoided: rounding 10.319 to 10 would give a count whose cumulative probability is still below 0.90.

Worked Example: Quantile When Counting Failures Before Success

A hypothetical monitoring device reports a signal independently on each check, with probability \(p=0.25\) per check. Let \(K\) be the number of checks with no signal before the first check that reports one. Find the 75th percentile of \(K\), and express the same result as a trial count.

Model and method. Here \(K\) has support \(0,1,2,\ldots\), not \(1,2,3,\ldots\). Apply the failures-before-success formula with \(\alpha=0.75\):

$$ \frac{\ln(1-0.75)}{\ln(1-0.25)} = \frac{\ln(0.25)}{\ln(0.75)} \approx 4.819. $$

The corresponding trial-count quantile is \(\lceil 4.819\rceil=5\), so the failures-before-success quantile is \(q_{0.75}(K)=5-1=4\). Verify directly:

$$ F_K(3)=1-0.75^4=1-0.31640625=0.68359375, $$
$$ F_K(4)=1-0.75^5=1-0.2373046875=0.7626953125. $$

The probability has not reached 0.75 by 3 failures but has reached it by 4 failures. The equivalent trial count is one more: the first signal occurs by the fifth check with probability \(0.7627\), whereas it occurs by the fourth check with probability \(0.6836\). Common mistake avoided: reporting 5 as the answer to a question asking for failures. Five is the trial-count quantile; the failures-before-success answer is 4.

Worked Example: Choosing a Deadline for a 99% Success Probability

A hypothetical independent quality screen detects a specified condition with probability \(p=0.10\) on each specimen tested. Let \(T\) be the test number of the first detection. What is the smallest number of tests needed for the probability of at least one detection to be at least 0.99?

Model and method. \(T\) is geometric on the positive integers with \(p=0.10\). A deadline of \(n\) tests meets the requirement exactly when \(F_T(n)\ge0.99\). Solve using the 99th-percentile formula:

$$ \frac{\ln(1-0.99)}{\ln(1-0.10)} = \frac{\ln(0.01)}{\ln(0.90)} \approx 43.709. $$

The smallest integer at least this large is 44. To verify that 44 is the minimum, evaluate both boundary probabilities:

$$ F_T(43)=1-0.90^{43}\approx 0.9892, \qquad F_T(44)=1-0.90^{44}\approx 0.9903. $$

The probabilities are rounded to four decimals. Forty-three tests fall short of the 0.99 requirement, while 44 meet it. Therefore, the smallest qualifying deadline is 44 tests. Common mistake avoided: using the expected waiting time \(1/p=10\) as a deadline. An average waiting time does not guarantee a 99% cumulative probability.

Interpreting Medians and Integer Boundaries

The lower median is found by setting \(\alpha=0.50\) in the quantile formula. For trials until the first success, this gives the smallest integer \(n\) for which \(1-(1-p)^n\ge0.50\). A median describes a cumulative-probability threshold; it is not a statement that the waiting time is equally likely to be above or below one particular integer in every discrete distribution.

For a discrete distribution, more than one value can satisfy the usual median conditions \(P(X\le m)\ge0.50\) and \(P(X\ge m)\ge0.50\). For example, when \(p=0.50\), \(T\) has \(P(T\le1)=0.50\). Both support values 1 and 2 satisfy those conditions: \(P(T\ge1)=1\), and \(P(T\ge2)=0.50\). The lower-quantile convention selects 1 as the lower median. When a question asks for “the median,” stating the convention or identifying the lower median avoids ambiguity if the cumulative probability lands exactly on one-half.

A useful final check is to compare the proposed quantile with its predecessor. For \(T\), verify \(F_T(n-1)<\alpha\le F_T(n)\). For \(K\), verify \(F_K(k-1)<\alpha\le F_K(k)\), with the lower boundary adjusted when \(k=0\). This check catches both an incorrect ceiling and a one-unit support shift.

QuantitySupportCumulative probabilityLower \(\alpha\)-quantile
Trials through first success, \(T\)1, 2, 3, ...\(F_T(n)=1-(1-p)^n\)\(\left\lceil\ln(1-\alpha)/\ln(1-p)\right\rceil\)
Failures before first success, \(K\)0, 1, 2, ...\(F_K(k)=1-(1-p)^{k+1}\)\(\left\lceil\ln(1-\alpha)/\ln(1-p)\right\rceil-1\)

Common Exam Traps

  • Rounding to the nearest integer. A quantile must reach or exceed the target cumulative probability. Use the ceiling and verify the adjacent integers.
  • Switching the support convention. Trials through success start at 1; failures before success start at 0. Their quantiles differ by exactly one.
  • Forgetting the negative logarithm denominator. Since \(\ln(1-p)<0\), dividing an inequality by it reverses the inequality. The resulting threshold is a lower bound on the count.
  • Confusing a median with a mean. The mean \(1/p\) describes an average waiting time, while the median is defined by the cumulative probability reaching one-half.
  • Ignoring an exact boundary. If a cumulative probability equals the target exactly, that support value already qualifies. Do not add one merely because the inequality is not strict.
Key takeaway: A geometric quantile is the first integer at which the cumulative probability reaches the requested level. Solve the logarithmic threshold, use the appropriate support convention, and check the cumulative probability at the selected count and the one immediately before it.

Check Your Understanding

For each problem, identify the support convention before calculating, and check the integer boundary when appropriate.

  1. A hypothetical sensor gives an independent alert with probability \(0.40\) at each inspection. If \(T\) is the inspection number of the first alert, find the lower median of \(T\). (Answer: 2 inspections)
  2. Independent service checks each succeed with probability \(0.20\). If \(K\) counts failures before the first success, find its 90th percentile. (Answer: 10 failures)
  3. A hypothetical sample test has independent detection probability \(p=0.125\) on each specimen. If \(T\) counts the specimen on which the first detection occurs, find the 95th percentile of \(T\). (Answer: 23 specimens)
  4. For independent trials with success probability \(p=0.50\), find the lower median of the trial count \(T\), and state whether the support value immediately above it also satisfies the usual median conditions. (Answer: Lower median 1; support value 2 also satisfies the usual median conditions)
  5. A hypothetical device check succeeds independently with probability \(p=0.25\) each time. Find the smallest number of checks needed for the probability of at least one success to be at least 0.80. (Answer: 6 checks)
Clinical Biostats