Negative Binomial Calculator (Trials Until the r-th Success)
The chance of getting your r-th success on a given trial or within a given number of trials, and how many trials it takes on average.
Results
The dashed line marks the value you entered.
What this tool does
Where the binomial distribution counts successes in a fixed number of trials, the negative binomial turns it round: it counts the trials needed to reach a fixed number of successes. It answers questions such as how many sales calls to land five deals, or how many rolls before three sixes. With r = 1 it is the geometric distribution — the wait for the first success, with mean 1 ÷ p. On average you need r ÷ p trials, but the spread is wide: the chance of needing more than the average is substantial. Trials are assumed independent with a constant chance of success.
Formula
P(r-th success on trial k) = C(k − 1, r − 1) pʳ (1 − p)ᵏ⁻ʳ · P(within k) = 1 − Σⱼ₌₀^(r−1) C(k, j) pʲ (1 − p)ᵏ⁻ʲ · mean = r ÷ p
Variables
| Symbol | Meaning | Unit |
|---|---|---|
r | Successes you need (r) | — |
pp | Chance of success on each trial | % |
k | Number of trials you are asking about (k) | — |
PC | Chance of getting the r-th success within k trials | % |
PK | Chance the r-th success comes exactly on trial k | % |
PM | Chance you need more than k trials | % |
ME | Average number of trials needed | — |
SD | Standard deviation of the trials needed | — |
Worked example
- Successes you need (r)3
- Chance of success on each trial25 %
- Number of trials you are asking about (k)10
- Chance of getting the r-th success within k trials47.441 %
- Chance the r-th success comes exactly on trial k7.508 %
- Chance you need more than k trials52.559 %
- Average number of trials needed12.00
- Standard deviation of the trials needed6.00
Limitations
- The calculation runs at full precision and only the display is rounded. If you copy an intermediate value and retype it, small differences can appear.
- The default values are typical reference figures, not measurements of your situation. Replace them with your own data whenever you have it.