Geometric Distribution Calculator
Find the probability that the first success happens on a given trial, within k trials or later, with the mean, median and variance.
Statistical results depend on the assumptions stated in the formula. Check that your data meet them before drawing conclusions.
What is the geometric distribution?
The geometric distribution gives the probability that the first success in a series of independent yes-or-no trials happens on a particular trial, when each trial has the same chance of success. It answers questions such as how many attempts it takes to roll a six.
How to use this calculator
Enter the probability of success on each independent trial and the trial number you are interested in. Choose whether you count the trial on which success happens or the failures before it; textbooks use both conventions.
Formula
Counting trials: P(X = k) = (1 − p)^(k − 1) × p, P(X ≤ k) = 1 − (1 − p)^k, P(X ≥ k) = (1 − p)^(k − 1). Mean = 1/p, variance = (1 − p)/p², median = ⌈−1 ÷ log₂(1 − p)⌉. Counting failures, use k + 1 trials and subtract 1 from the mean and median.
Terms in the formula
- p
- Probability of success on each trial.
- k
- The trial number (or number of failures).
- 1 − p
- Probability of failure on each trial.
Understanding your result
The exact probability falls with each later trial, because early success is always the most likely single outcome. The cumulative probability shows the chance of success within k trials, useful for planning how many attempts to allow. The mean is the long-run average number of trials; the median is the number of trials after which success is at least 50% likely.
Calculator credits
Calculator developmentJulia Edwards
Editorial supervisionSamad Aslam Khan
Expert reviewSaeedM.Phil Statistics, Data Scientist
Published byThe Calculatorz
Last updated
Read how we research, test, review and correct our calculators in our editorial policy.
Frequently asked questions
What is a geometric distribution?
It models the number of independent trials needed to get the first success when each trial has the same success probability p, such as rolling a die until a 6 appears.
What is the difference between the two conventions?
One counts the trial on which the first success happens (1, 2, 3…); the other counts failures before it (0, 1, 2…). The probabilities match after shifting by one.
Is the geometric distribution memoryless?
Yes. If you have already failed several times, the chance of needing k more trials is the same as at the start. Past failures do not make success more likely.
How is it different from the binomial distribution?
A binomial counts successes in a fixed number of trials. A geometric counts trials until the first success, so the number of trials is not fixed.
How many tries do I need to be 95% sure of one success?
Solve 1 − (1 − p)^k ≥ 0.95, so k ≥ ln(0.05) ÷ ln(1 − p). With p = 20%, k = 14 trials.
What is the expected number of trials?
1/p. With a 1 in 6 chance, you expect to roll a die 6 times on average to get a particular number.
References & methodology sources
These sources support the calculator’s formula, definitions, thresholds, units or result interpretation.
- Weisstein, E. W. (n.d.). Geometric distribution. MathWorld—A Wolfram Web Resource. View source
- Illowsky, B., & Dean, S. (2023). Introductory statistics 2e. OpenStax. View source
- Casella, G., & Berger, R. L. (2002). Statistical inference (2nd ed.). Duxbury. View source
- Croarkin, C., & Tobias, P. (Eds.). (2012). NIST/SEMATECH e-handbook of statistical methods. National Institute of Standards and Technology. View source