Geometric Distribution Calculator

Geometric distribution: chance the first success comes on trial k, within k trials or after k trials, plus the mean and variance. Count trials or failures.

A decimal greater than 0 and at most 1, such as 0.2 for a 20% chance each time. Trials must be independent with the same p.
Textbooks use both. OpenStax counts trials; many software packages count failures.
A whole number. At least 1 when counting trials, at least 0 when counting failures.

Results

P(X = 4)
0.1024
P(X ≤ 4)
0.5904
P(X > 4)
0.4096
P(X ≥ 4)
0.512
Mean (1 ÷ p)
5.00
Variance ((1 − p) ÷ p²)
20.00
Standard deviation
4.4721

How it’s calculated

The geometric distribution describes how long you wait for the first success when you repeat independent trials that each succeed with the same probability p: shots until the first basket, calls until the first sale, rolls until the first six. It has a "memoryless" property: past failures do not change the chance on the next trial.

Choose what X counts. Counting trials (the first success is on trial X = k), the formulas are:

P(X = k) = (1 − p)^(k − 1) · p P(X ≤ k) = 1 − (1 − p)^k P(X > k) = (1 − p)^k mean = 1 ÷ p, variance = (1 − p) ÷ p²

Counting failures before the first success (X = k failures), shift by one: P(X = k) = (1 − p)^k · p, P(X ≤ k) = 1 − (1 − p)^(k + 1), and the mean is (1 − p) ÷ p. The variance is the same.

Worked example: a shooter hits with probability p = 0.2 each attempt. The chance the first hit comes on attempt 4 is 0.8³ × 0.2 = 0.1024. The chance of a hit within 4 attempts is 1 − 0.8⁴ = 0.5904, the chance it takes more than 4 is 0.4096, and on average it takes 1 ÷ 0.2 = 5 attempts (variance 0.8 ÷ 0.04 = 20).

Frequently asked questions

Which convention should I use, trials or failures?

Use the one your course or software uses. If your problem says "on the 4th trial" or "how many tries", count trials. If it says "how many failures before the first success", count failures. The two differ only by a shift of one.

What does "memoryless" mean?

Each trial is independent, so having failed several times does not make success any more likely next time. The chance of waiting at least j more trials is the same no matter how long you have already waited.

What is the difference between P(X ≤ k) and P(X < k)?

P(X ≤ k) includes k itself. For "fewer than k", use P(X ≤ k − 1), or take P(X ≥ k) and subtract it from 1.

When is a geometric distribution not appropriate?

When the chance of success changes from trial to trial, or trials depend on each other (for example, drawing cards without replacement). Then a hypergeometric or other model fits better.

Embed this calculator

Add this free calculator to your own website. Copy the code below into your page’s HTML:

Need this calculator branded, changed or built around your own prices?See custom business solutions →

Sources

Formulas are taken from the free public references above. Results are provided “as is” for informational and educational purposes only. See our disclaimer.

Added · Last updated · How we check our calculators

Spotted a mistake or missing option? Report a problem· Suggest a calculator