Connect via MCP →

Enter Calculation

Formula

Advertisement

Results

Percentile point x (integer number of failures)
3
smallest integer x meeting the cumulative probability
Continuous (real-valued) solution 2.1506601031

What this calculator does

This tool returns the percentile (quantile) of the geometric distribution: given a cumulative probability and the per-trial success probability p, it finds the value x. Here the geometric distribution counts the number of failures before the first success, supported on \(x = 0, 1, 2, 3, \ldots\). Its probability mass function is $$f(x, p) = p(1 - p)^{x}.$$

Bar chart of geometric distribution probabilities decreasing geometrically over trial counts
The geometric distribution: probability of needing x failures (or trials) before the first success, decreasing geometrically.

The two cumulative conventions

You can work from either tail. The lower cumulative \(P(x, p) = 1 - (1 - p)^{x+1}\) is the probability of at most x failures. The upper cumulative \(Q(x, p) = (1 - p)^{x}\) is the probability of at least x failures. Pick the matching mode, then enter that probability.

Advertisement
Two bar charts showing lower-tail area P shaded on the left and upper-tail area Q shaded on the right
Lower-tail probability P (left) versus upper-tail probability Q (right) under the same geometric distribution.

The formula explained

Let \(q = 1 - p\). Inverting the lower CDF: \(1 - q^{x+1} = P\) gives $$x = \frac{\ln(1 - P)}{\ln(q)} - 1.$$ Inverting the upper CDF: \(q^{x} = Q\) gives $$x = \frac{\ln(Q)}{\ln(q)}.$$ Because x must be an integer count of failures, the reported percentile point is \(\lceil x \rceil\), clamped to be at least 0. The continuous real-valued solution is also shown for precision work.

Worked example

Lower mode, \(P = 0.8\), \(p = 0.4\). Then \(q = 0.6\), \(\ln(0.6) = -0.5108256\). $$x = \frac{\ln(0.2)}{\ln(0.6)} - 1 = \frac{-1.6094379}{-0.5108256} - 1 = 3.151035 - 1 = 2.151035.$$ Rounding up gives the integer percentile \(x = 3\). Check: \(P(3) = 1 - 0.6^{4} = 0.8704 \ge 0.8\), while \(P(2) = 0.784 < 0.8\), confirming \(x = 3\).

FAQ

Why does ceil give the percentile? The integer quantile is the smallest x whose cumulative probability reaches the target, so we round the continuous solution up.

What if p = 0 or p = 1? With \(p = 0\) success never happens, so the quantile is undefined/infinite. With \(p = 1\) all mass sits at \(x = 0\), so the quantile is 0.

Can P be exactly 1? No finite x reaches \(P = 1\) in lower mode (the CDF only approaches 1), so that input is reported as undefined.

Last updated: