Geometric Distribution Calculator – Trials to First Success
The geometric distribution is a discrete probability distribution that models the number of independent Bernoulli trials needed to obtain the first success, given a constant per-trial success probability p. It answers questions like: how many sales calls will it take to land the first sale, how many coin flips until the first heads, or on which inspection the first defective part turns up. This calculator computes the exact probability mass function, cumulative probability, upper-tail probability, and key distribution statistics for any success probability and trial count.
Two Equivalent Parameterizations
Statisticians describe the geometric distribution in two interchangeable ways. The trials-until-first-success version counts the trial number on which the first success occurs, with support k = 1, 2, 3, … — its PMF is P(X = k) = (1 − p)^(k − 1) × p. The failures-before-first-success version instead counts only the failures that preceded the success, with support k = 0, 1, 2, … and PMF P(X = k) = (1 − p)^k × p. Both describe the same underlying experiment and differ only by a shift of one trial, so this calculator lets you switch between them and automatically adjusts the formulas and valid input range.
Exact, Cumulative, Upper-Tail, and Interval Probabilities
The exact mode gives P(X = k), the probability the first success lands on precisely the k-th trial. The cumulative mode gives P(X ≤ k), computed as 1 − (1 − p)^k for the trials version. The upper-tail (survival) mode gives P(X ≥ k) — the probability that at least k trials are needed, equal to (1 − p)^(k − 1). The interval mode combines two cumulative probabilities to compute P(a ≤ X ≤ b) for a bounded range of trial counts.
Mean, Variance, and the Memoryless Property
For the trials parameterization, the expected number of trials until the first success is E[X] = 1/p; for the failures parameterization it's E[X] = (1 − p)/p. Both share the same variance, Var(X) = (1 − p)/p². A defining feature of the geometric distribution is that it is memoryless: the probability of needing n more trials doesn't depend on how many trials have already failed. This is the only discrete distribution with this property, and it makes the geometric model especially convenient for reliability and waiting-time problems.
Relationship to Other Distributions
The geometric distribution is a special case of the negative binomial distribution with r = 1required success. It is also the natural "waiting time" counterpart to the binomial distribution: binomial counts successes across a fixed number of trials, while geometric counts trials needed for a fixed number (one) of successes. Understanding this relationship helps when choosing the right model for quality control, reliability testing, or conversion-rate analysis.
How This Calculator Works
Enter the success probability p as a decimal between 0 and 1, choose your parameterization and calculation mode, then supply the trial or failure count. The calculator evaluates the closed-form PMF and CDF formulas using log-space arithmetic for numerical stability when p is very small or k is very large, and displays the result alongside a probability table and an interactive PMF bar chart with an optional CDF overlay.
Common Use Cases
Quality-control analysts use the geometric distribution to estimate how many units must be inspected before finding a defect; sales and marketing teams model the expected number of contacts before a conversion; reliability engineers estimate the number of test cycles before a first failure; and students use it to build intuition for waiting-time problems in introductory probability courses.