Calculate expected trials, trials for a target confidence, reverse per-trial probability, or expected trials for multiple successes with median and spread details.
Related Calculators
- Compound Probability Calculator
- Defective Probability Calculator
- First Pass Yield Calculator
- Rain Probability Calculator
- All Statistics Calculators
Expected Number of Trials Formula
For an event with a constant success chance per trial, the expected number of trials until the first success follows the geometric distribution.
- E = expected number of trials until the first success (includes the successful trial)
- p = probability of success on a single trial (0 < p ≤ 1)
To find how many trials you need to reach a target chance of at least one success:
- n = trials needed, rounded up
- T = target probability of at least one success (e.g. 0.95)
For p = 1, the first success takes one trial. A 0% cumulative target needs zero trials; a 100% target needs p = 1 and otherwise has no finite trial count. To estimate p from observations, use p = successes / trials. Assumptions: trials are independent, p does not change between trials, and each trial has only two outcomes (success or failure).
Reference Tables
Use these to sanity check the calculator output without re-running it.
| Success chance (p) | Expected trials (1/p) | Trials for 90% | Trials for 95% | Trials for 99% |
|---|---|---|---|---|
| 50% | 2 | 4 | 5 | 7 |
| 25% | 4 | 9 | 11 | 17 |
| 10% | 10 | 22 | 29 | 44 |
| 5% | 20 | 45 | 59 | 90 |
| 1% | 100 | 230 | 299 | 459 |
| 0.1% | 1,000 | 2,302 | 2,995 | 4,603 |
| Result | What it means |
|---|---|
| E = 1/p | Long-run average; it does not split outcomes in half. The median gives the 50% threshold. |
| Median = ceil(ln(0.5)/ln(1−p)) | The smallest trial count with at least a 50% chance of success; it can equal the mean. For p = 1, both are 1. |
| Std. deviation = √(1−p)/p | For low p, this is close to E itself, so spread is wide. |
| Trials at 95% target | Roughly 3× the expected count for small p. |
Worked Example
A drop has a 5% chance per kill. The expected number of kills to get one drop is 1 / 0.05 = 20.
That does not mean you are guaranteed a drop by kill 20. The actual chance of at least one drop in 20 kills is 1 − (0.95)20 ≈ 64.2%. To hit 95% confidence, solve n = ln(0.05) / ln(0.95) ≈ 58.4, which rounds up to 59 kills.
FAQ
Does the expected count include the successful trial? Yes. E = 1/p counts the success itself. Expected failures before the first success is (1 − p) / p.
Why does my actual run take so much longer than expected? When p is below 1, the geometric distribution has a long right tail. A run can take much longer than the mean; the median and target-chance counts describe different parts of that distribution. At p = 1, success occurs on the first trial.
Can I use this if p changes between trials? No. The formula assumes p is constant. If the rate changes, the geometric model does not apply.
What if I want a specific number of successes, not just one? The expected trials for k successes is k / p. Select Expected trials for multiple successes to calculate k / p and its standard deviation.
