Advanced

Negative Binomial Distribution Calculator

Compute the probability of observing a given number of failures before the r-th success in a sequence of independent Bernoulli trials.
Number of successes that ends the experiment
Probability of success on each trial (0–1)
Number of failures before the r-th success

Mode

Probability
0.187500

Probability of exactly 2 failures before success #3

Mean failures
3
Variance
6
Std deviation
2.4495
P(exactly k)
0.1875
k=00.125
k=10.1875
k=20.1875
k=30.1563
k=40.1172
k=50.082
k=60.0547
k=70.0352
k=80.022
k=90.0134
Step by step
  1. 1

    log C(k + r − 1, k)

    log C(4, 2) = 1.7918
  2. 2

    r × log(p)

    3 × log(0.5) = -2.0794
  3. 3

    k × log(1 − p)

    2 × log(0.5) = -1.3863
  4. 4

    log P(X = k)

    1.7918 + (-2.0794) + (-1.3863) = -1.674
  5. 5

    P(X = k)

    e^(-1.674) = 0.187500
    Exponentiate the log-probability to get the PMF value.
Results are estimates for general information only and are not professional advice — always verify important results independently before relying on them. Read the full disclaimer.
Quick answer

How does this calculator work?

The negative binomial distribution gives P(X = k) = C(k+r−1, k)·p^r·(1−p)^k, the chance of k failures before the r-th success. Enter r, p, and k to get the exact or cumulative probability, plus the mean r(1−p)/p and variance r(1−p)/p² of the failure count.

Formula
P(X = k) = C(k + r − 1, k) · p^r · (1 − p)^k, Mean = r(1−p)/p, Var = r(1−p)/p²
How this is calculated

The negative binomial (Pascal) distribution models the number of failures X = k that occur before the r-th success, where each independent trial succeeds with probability p. The probability mass function is P(X = k) = C(k + r − 1, k) · p^r · (1 − p)^k for k = 0, 1, 2, …. The binomial coefficient counts the arrangements of the first k failures and r − 1 successes among the first k + r − 1 trials; the final trial is always the r-th success. This calculator evaluates the coefficient through the log-gamma function so it stays numerically stable for large r and k.

Enter r (successes needed, a positive integer), p (per-trial success probability between 0 and 1), and k (failures). The mode selector chooses between an exact point probability P(X = k), the lower cumulative P(X ≤ k), and the upper tail P(X ≥ k) = 1 − P(X ≤ k − 1). The mean number of failures is r(1 − p)/p and the variance is r(1 − p)/p², so the spread grows quickly as p approaches 0.

Assumptions: trials are independent and identically distributed, p is constant, and counts are non-negative integers (k is rounded). The result is undefined when p ≤ 0 or p > 1; as p → 1 the distribution collapses toward k = 0 because successes arrive almost immediately.

Frequently asked questions

The binomial fixes the number of trials and counts successes; the negative binomial fixes the number of successes (r) and counts the failures (or trials) needed to reach them.

It counts failures k before the r-th success. The total number of trials is k + r, so add r to convert.

With r = 1 the negative binomial reduces to the geometric distribution: the probability of k failures before the first success.

Also known as

negative binomial distribution
failures before success
pascal distribution
rth success probability
negative binomial pmf
negative binomial probability
number of failures until r successes

APA

TG we-Calculate Editorial Team. (2026). Negative Binomial Distribution Calculator [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/negative-binomial-distribution-calculator

Chicago

TG we-Calculate Editorial Team. "Negative Binomial Distribution Calculator." TG we-Calculate. 2026. https://we-calculate.com/calculator/negative-binomial-distribution-calculator.

IEEE

TG we-Calculate Editorial Team, "Negative Binomial Distribution Calculator," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/negative-binomial-distribution-calculator

BibTeX

@misc{wecalculate_negative_binomial_distribution_calculator, title = {Negative Binomial Distribution Calculator}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/negative-binomial-distribution-calculator}}, year = {2026}, note = {TG we-Calculate} }

Did this calculator help you?