Geometric Distribution Calculator
Enter the success probability p and a trial number k to get the probability the first success occurs exactly on trial k — the geometric distribution PMF.
First-success probability
Enter the per-trial success probability and the trial number and the calculator returns P(X = k) = (1 − p)^(k − 1) × p straight away.
Independent trials
The geometric distribution assumes independent, identical trials, each with the same success probability p, and k is a positive whole number.
What is the geometric distribution?
The probability of the first success
The geometric distribution calculator answers a single, common question: in a sequence of independent trials that each succeed with the same probability p, what is the chance the very first success arrives exactly on trial k? Think of flipping a biased coin until it lands heads, rolling a die until you get a six, or sending requests until one finally goes through. The probability mass function P(X = k) = (1 − p)^(k − 1) × p multiplies the chance of (k − 1) failures by the chance of one success on the final trial. Enter the success probability and the trial number, and you get that probability directly.
Enter a success probability p and a trial number k to get the chance the first success occurs exactly on trial k instantly.
The probability is the chance of (k − 1) failures in a row, each with probability (1 − p), followed by a single success with probability p.
P(X = k) = (1 − p)^(k − 1) × pEach of the first (k − 1) trials must fail, and failures are independent, so their probabilities multiply to (1 − p)^(k − 1). The k-th trial then succeeds with probability p. Because every extra failure multiplies in another factor of (1 − p), the probability shrinks geometrically as k grows.
Suppose each trial succeeds with probability p = 0.2 and you want the chance the first success occurs on trial k = 3.
Count the failures
The first 3 − 1 = 2 trials must fail, each with probability 1 − 0.2 = 0.8.
Multiply the failure probabilities
0.8^2 = 0.64 — the chance of two failures in a row.
Multiply by the success
0.64 × 0.2 = 0.128 — the probability the first success is exactly on trial 3.
The result is the probability that the first success occurs exactly on trial k — not on or before it. For p = 0.2 and k = 3 that is 0.128, so out of many repeated experiments roughly 12.8% would see their first success on the third trial. Notice the probabilities decline as k increases: the first success is most likely on trial 1 (probability p), and each later trial is less likely because it requires more failures first. A useful companion number is the mean, the expected trial of the first success, which is 1/p. With p = 0.2 the mean is 1 ÷ 0.2 = 5, so on average the first success arrives on the fifth trial — even though trial 1 is individually the single most likely outcome. The smaller p is, the longer you typically wait and the more spread out the distribution becomes.
The formula is exact, but it rests on a few assumptions worth keeping in mind.
Independent, identical trials and a whole-number k
This calculator uses the geometric distribution, which assumes the trials are independent and that every trial has the same success probability p. If the probability changes between trials or earlier outcomes affect later ones, the formula no longer applies. The trial number k must be a positive integer — the first success cannot occur on trial 2.5 — and p must lie between 0 and 1. This is the "trial of first success" form of the distribution; some textbooks instead count the number of failures before the first success, which shifts k by one.