What the geometric distribution describes
The geometric distribution models how many independent attempts you need until the first success, when every attempt has the same probability of success p. Rolling a die until a six appears, calling a sales lead until someone agrees to a demo, or testing manufactured parts until the first defect is found are all examples. The random variable X is the trial number on which the first success happens, so X can be 1, 2, 3 and so on with no upper limit.
Enter p as a decimal between 0 and 1 (for example 0.25 for 25%). The calculator returns the mean, variance, standard deviation, mode and median, and tables for the probability that the first success falls exactly on trial k and within the first k trials, for k from 1 to 6. It is a good fit when trials are independent and p does not change from one attempt to the next.
The formulas
For the version that counts trials up to and including the first success, the standard results are:
- P(X = k) = (1 − p)k−1 × p, the chance that the first k − 1 trials fail and trial k succeeds.
- P(X ≤ k) = 1 − (1 − p)k, the chance of at least one success within k trials.
- Mean E[X] = 1 / p and Variance = (1 − p) / p², with the standard deviation as its square root.
- Mode = 1, because the single most likely trial is always the first.
- Median = ⌈ln(0.5) / ln(1 − p)⌉, the smallest k where P(X ≤ k) reaches 50%.
Worked example
Suppose each attempt succeeds with p = 0.25. The mean is 1 / 0.25 = 4 trials. The variance is 0.75 / 0.0625 = 12, so the standard deviation is √12 ≈ 3.4641. The median is ⌈ln 0.5 / ln 0.75⌉ = ⌈−0.6931 / −0.2877⌉ = ⌈2.409⌉ = 3.
For the table: P(X = 1) = 0.25, P(X = 2) = 0.75 × 0.25 = 0.1875, and P(X = 3) = 0.75² × 0.25 = 0.140625. The cumulative probability within 3 trials is 1 − 0.75³ = 1 − 0.421875 = 0.578125. The calculator prints exactly these values, and the mean of 4 is worth noting: even though the average wait is four trials, the most likely single outcome is success on the first.
Common mistakes and how to interpret the result
- Mixing the two conventions. Some textbooks define the geometric variable as the number of failures before the first success, starting at 0. This calculator counts trials, starting at 1. The mean of the failures version is (1 − p)/p, one less than 1/p.
- Reading the mean as a guarantee. An average of 4 trials does not mean success by trial 4. In the example above, P(X ≤ 4) is only about 0.68, and the distribution has a long right tail.
- Assuming a changing probability. If success gets easier or harder over time, or you sample without replacement from a small population, the geometric model does not apply.
- Entering a percentage. The input must be a decimal from above 0 up to 1. Entering 25 instead of 0.25 is rejected.
Related calculators
- Binomial Distribution Calculator
- Negative Binomial Distribution Calculator
- Expected Value Calculator
- Exponential Distribution Calculator
Common Measurement Conversions for Everyday Use
| Quantity | US / Imperial | Metric Equivalent |
|---|---|---|
| 1 cup | 8 fl oz | 237 mL |
| 1 pint | 16 fl oz | 473 mL |
| 1 quart | 32 fl oz | 946 mL |
| 1 gallon | 128 fl oz | 3.785 L |
| 1 lb | 16 oz | 453.6 g |
| 1 ft | 12 in | 30.48 cm |