The geometric distribution models how many independent, identical trials you must perform until the first success occurs. Each trial has only two possible outcomes (success or failure) and the probability of success is the same on every trial. The random variable typically counts either:
This calculator uses the first convention: X is the trial number of the first success, so X takes values 1, 2, 3, and so on.
Typical examples include:
Let X be the trial on which the first success occurs, and let p be the probability of success on each trial (with 0 < p ≤ 1). The probability that the first success happens exactly on trial k (for k = 1, 2, 3, ...) is given by the probability mass function (PMF):
P(X = k) = (1 - p)^{k - 1} p.
This expression reflects the idea that you must see k - 1 failures in a row, followed by one success.
The cumulative distribution function (CDF) gives the probability that the first success occurs on or before trial k:
P(X ≤ k) = 1 - (1 - p)^{k}.
This is one minus the probability that all of the first k trials are failures.
The geometric distribution also has simple expressions for the mean (expected value) and variance:
As p decreases, both the expected number of trials and the variance increase. When successes are rare, you typically wait longer and see more variability in the waiting time.
The geometric distribution is memoryless. Formally, for all integers s, t ≥ 0,
P(X > s + t ∣ X > s) = P(X > t).
This means that, if you still have not seen a success after s trials, the conditional distribution of the additional waiting time does not depend on how long you have already waited. In practice, each new trial behaves as if you were starting the process again.
The calculator is designed around the parameterization where X counts the trial of the first success. You provide two inputs:
After entering p and k and selecting “Compute”, the calculator typically returns three core quantities:
You can use these outputs to answer questions like:
Suppose you are flipping a biased coin that lands on heads with probability p = 0.3 on each flip. You want to know the probability that you get the first heads on the 4th flip or earlier.
First, compute the probability that the first heads occurs exactly on flip 4:
P(X = 4) = (1 - p)^{4 - 1} p = (0.7)^{3} × 0.3.
Numerically, this is:
(0.7)^{3} = 0.343,
so
P(X = 4) ≈ 0.343 × 0.3 = 0.1029.
In other words, there is about a 10.29% chance that the first heads appears exactly on the fourth flip.
Next, compute the probability that the first heads occurs on or before the fourth flip:
P(X ≤ 4) = 1 - (1 - p)^{4} = 1 - (0.7)^{4}.
We have
(0.7)^{4} = 0.2401,
so
P(X ≤ 4) = 1 - 0.2401 = 0.7599.
Thus, there is about a 75.99% chance that you see at least one heads within the first four flips.
The calculator will also report the mean and variance for X when p = 0.3:
The mean says you should expect, on average, a little more than 3 flips to get the first heads. The relatively large variance (7.78) confirms that outcomes can vary quite a bit around this typical value, especially because p is noticeably less than 0.5.
The geometric distribution sits alongside several closely related discrete distributions. The table below summarizes the main differences that matter when you choose a model or compare software outputs.
| Distribution / parameterization | What it counts | Support (possible values) | Typical use |
|---|---|---|---|
| Geometric (this calculator: X) | Trial number of the first success | 1, 2, 3, ... | Waiting time until first event, counted in trials. |
| Geometric (alternative: Y) | Number of failures before the first success | 0, 1, 2, ... | Same situations as above, but counting failures instead of trials. Related to X via X = Y + 1. |
| Negative binomial | Number of trials needed for the r-th success (or number of failures before r-th success) | r, r + 1, r + 2, ... (or 0, 1, 2, ... depending on convention) | Waiting time until more than one success; geometric is the special case r = 1. |
| Binomial | Number of successes in a fixed number of n trials | 0, 1, ..., n | Fixed trial count with interest in how many successes occur, not when the first appears. |
Many software packages offer both geometric parameterizations. For example, some functions return the probability that there are y failures before the first success, while others return the probability that the first success occurs on trial k. When checking documentation, look carefully at whether the support starts at 0 or 1, and apply the conversion X = Y + 1 if you need to translate between them.
Once the calculator has produced values for P(X = k), P(X ≤ k), and the mean and variance, you can interpret them as follows:
In quality control or reliability settings, you can compare empirical data (for example, observed numbers of tests until the first failure in many components) with the geometric mean and variance to see whether the assumption of a constant per-trial failure probability is plausible.
To use the geometric distribution and this calculator correctly, several assumptions must hold. They are often reasonable but are not automatic in real data.
Being explicit about these assumptions helps avoid misinterpretation. If you find that the geometric distribution does not capture the variability or patterns in your data, consider whether any of the assumptions above are violated and whether an alternative model might be more suitable.