Negative Binomial Distribution PMF / PDF Value Calculator

Calculate negative binomial probabilities with professional, intuitive controls, live feedback throughout. Switch between failures or trials definitions with clear parameter mapping for accuracy. Handles real r using gamma math, with transparent, stepwise derivations for confidence. Export results quickly as CSV tables or PDF files.

Inputs

Choose variable definition for the discrete outcome.
Rounding used in displays and exports.
r > 0. Can be real; gamma math supported.
0 < p < 1
Integer count of failures before r-th success.
Integer trials to reach r-th success (n ≥ r).

Status Waiting for inputs.

Steps

Example Data Table

# Mode r p x n PMF log PMF

Rows reflect the current inputs at the moment of adding. Use the example loader to generate a quick series.

Formula used

We adopt the "failures before the r-th success" definition. For success probability \(p\), target successes \(r>0\), and failures \(x=0,1,\dots\):

\[ \Pr(X=x) = \binom{x+r-1}{x} (1-p)^{x} p^{\,r} = \frac{\Gamma(x+r)}{\Gamma(r)\,\Gamma(x+1)} (1-p)^x p^r. \]

For the "total trials \(n\)" definition, set \(x=n-r\) (so \(n=r,r+1,\dots\)) and use the same expression with that \(x\).

Moments (for the failures form): \(\mathbb{E}[X] = r\frac{1-p}{p}\), \(\mathrm{Var}(X) = r\frac{1-p}{p^2}\).

How to use this calculator

  1. Choose whether you model failures \(x\) or total trials \(n\). The two definitions are equivalent via \(x = n - r\).
  2. Enter \(r\) > 0 and \(p\) with \(0<p<1\). Non‑integer \(r\) is supported via the gamma function.
  3. Enter \(x\) (integer \(\ge 0\)) or \(n\) (integer \(\ge r\)), then click Compute PMF.
  4. Review the stepwise derivation and numeric result. Use Add to Table to collect scenarios.
  5. Export your table using Download CSV or Download PDF. Adjust precision for rounding as needed.

Notes

Example: Using Negative Binomial PDF/PMF Value

Scenario (failures form): \(r=5,\; p=0.40,\; x=3\). The probability is \(\Pr(X=3)=\binom{3+5-1}{3}(1-0.40)^3(0.40)^5 = 0.0774144\). The natural log is about \(-2.558582\). Moments: mean \(=7.5\), variance \(=18.75\).

Click to load the example into the calculator.

Reference PMF Table (r = 5, p = 0.40)

Values for \(x=0,\dots,10\) under the failures parameterization.

xPMFlog PMF

Parameterizations and Support

Mode Random Variable Support Mapping to failures \(x\) PMF Form
Failures \(X\) \(0,1,2,\dots\) \(x=X\) \(\displaystyle \frac{\Gamma(x+r)}{\Gamma(r)\Gamma(x+1)}(1-p)^x p^r\)
Trials \(N\) \(r,r+1,r+2,\dots\) \(x=N-r\) \(\displaystyle \frac{\Gamma((N-r)+r)}{\Gamma(r)\Gamma((N-r)+1)}(1-p)^{N-r} p^r\)

Moments and Dispersion Examples

For failures form: \(\mathbb{E}[X]=r\frac{1-p}{p}\), \(\mathrm{Var}(X)=r\frac{1-p}{p^2}\). The dispersion index \(\mathrm{Var}/\mathbb{E}\) indicates over-dispersion versus Poisson when \(>1\).

rpMeanVarianceVariance / Mean

Related Calculators

Uniform Distribution PDF/PMF Value CalculatorPareto Distribution Quantile Percent Point CalculatorCauchy Distribution CDF Value CalculatorLaplace Distribution CDF Value CalculatorGeometric Distribution Moments Mean Variance CalculatorPoisson Distribution Random Sample Summary CalculatorPoisson Distribution Moments Mean Variance CalculatorDiscrete Uniform Distribution Moments Mean Variance Calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.