Home Calculators Negative Binomial Calculator
Discrete Probability Tool

Negative Binomial Calculator

Calculate negative binomial probabilities for the number of failures that occur before a specified number of successes. Enter the target number of successes, probability of success, and number of failures to calculate exact and cumulative probabilities plus important distribution statistics.

Exact P(X = x) Cumulative Probability Mean & Variance Instant Results

Enter Distribution Values

Model failures before the r-th success.

Number of successes required before stopping.
Probability of success on each independent trial.
Failures occurring before the r-th success.
Automatically calculated as q = 1 − p.
This calculator uses the convention where X is the number of failures observed before the r-th success. Trials are assumed to be independent with the same success probability p on each trial.
Probability Guide

What Is the Negative Binomial Distribution?

The negative binomial distribution is a discrete probability distribution that can model the number of failures that occur before a specified number of successes is reached in a sequence of independent Bernoulli trials.

Each trial has two possible outcomes, usually called success and failure, and the probability of success is assumed to stay constant from one trial to the next.

What Does X Represent?

In this calculator, X represents the number of failures before the r-th success. For example, if r = 5 and x = 3, the calculator finds the probability that exactly three failures occur before the fifth success.

How It Works

How to Use the Negative Binomial Calculator

01

Enter r

Enter the number of successes you want to achieve before the process stops.

02

Enter p and x

Provide the probability of success on each trial and the number of failures you want to evaluate.

03

Calculate Results

The calculator returns exact and cumulative probabilities plus the expected value, variance, standard deviation, and mode.

Example: Suppose each trial has a 40% chance of success and you need five successes. This calculator can find the probability that exactly three failures occur before the fifth success.
Probability Formula

Negative Binomial Probability Formula

For the failures-before-r-successes definition, the probability of exactly x failures is: P(X=x) = C(x+r−1, x)pr(1−p)x .

The combination term counts the ways that the first x+r−1 trials can contain exactly r−1 successes and x failures. The final trial must then be the r-th success.

What Are p and q?

The value p represents the probability of success on each trial. The probability of failure is q = 1 − p.

Distribution Statistics

Negative Binomial Mean and Variance

For the number of failures before the r-th success, the expected number of failures is: Mean = r(1−p) / p .

The variance is: Variance = r(1−p) / p² , and the standard deviation is the square root of that variance.

Expected Number of Total Trials

Because total trials equal successes plus failures, the expected number of trials required to reach r successes is: E(T) = r / p .

Comparison

Negative Binomial vs Geometric Distribution

Feature Negative Binomial Geometric
Stopping Point r-th success First success
Target Successes r ≥ 1 r = 1
Possible Failures 0, 1, 2, ... 0, 1, 2, ...
Relationship General case Special case of negative binomial
When r = 1, the failures-before-success version of the negative binomial distribution becomes the geometric distribution.
Key Difference

Negative Binomial vs Binomial Distribution

The binomial distribution fixes the number of trials and asks how many successes occur. The negative binomial distribution instead fixes the desired number of successes and allows the number of trials to vary.

For example, a binomial question may ask how many successes occur in 20 trials. A negative binomial question may ask how many failures occur before the fifth success.

Common Questions

Negative Binomial Calculator FAQs

It can calculate probabilities involving the number of failures that occur before a specified number of successes in repeated independent trials with a constant probability of success.
The parameter r is the target number of successes. The process stops when the r-th success occurs.
X is the number of failures that occur before the target number of successes is reached.
It is the probability that no more than x failures occur before the r-th success.
It is the probability that at least x failures occur before the r-th success.
For this calculator, the success probability p must be greater than 0 and less than or equal to 1.
Yes. Under the failures-before-success convention, the geometric distribution is the special case where r equals 1.
The calculations run directly in your browser using JavaScript, so your values do not need to be sent to a calculation server.