STATISTICSDistributionsStatistics Calculator
📊

Negative Binomial Distribution Calculator

Free negative binomial calculator. Trials until r successes. PMF, CDF, mean, variance. Dice, sales,

Run CalculatorExplore data analysis and statistical calculations

Why This Statistical Analysis Matters

Why: Statistical calculator for analysis.

How: Enter inputs and compute results.

🎲
STATISTICSDistributions

Negative Binomial — Trials Until r-th Success

Generalizes geometric distribution. How many dice rolls until your 3rd six? Sales calls until 5th sale? PMF, CDF, mean r/p.

Real-World Scenarios — Click to Load

Calculation Mode

Inputs

negbinom_results.sh
CALCULATED
$ negbinom --r=3 --p=0.3 --mode="exact"
Primary Probability
7.9380%
Mean (r/p)
10.0000
Variance
23.3333
Std Dev
4.8305
Share:
Negative Binomial (r=3, p=0.3)
P(X=5)
7.9380%
Mean = r/p = 10.00Variance = 23.33Generalizes Geometric
numbervibe.com/calculators/statistics/negative-binomial-distribution-calculator

PMF Bar Chart — P(X=k)

CDF Step Chart — P(X≤k)

Calculation Breakdown

SUMMARY
Mean (r/p)
10.0000
3/0.3000
Variance
23.3333
r(1-p)/p²
σ
4.8305
PROBABILITY
Primary Probability
7.9380%
C(5-1,3-1) × p^3 × (1-p)^2

For educational and informational purposes only. Verify with a qualified professional.

Key Takeaways

  • • X = number of trials until the r-th success. Generalizes geometric (r=1).
  • • PMF: P(X=k) = C(k-1, r-1) × p^r × (1-p)^(k-r) for k ≥ r
  • • Mean = r/p, Variance = r(1-p)/p² — more trials when p is small
  • • CDF: P(X ≤ k) = Σ P(X=i) for i=r..k
  • • When r is large, normal approximation: mean r/p, variance r(1-p)/p²

Did You Know?

🎲Rolling a die until you get three sixes — negative binomial with r=3, p=1/6Source: NIST
Number of at-bats until a batter gets 3 hits — "waiting for r successes"Source: Sports analytics
📞Sales calls until the 5th sale — each call is Bernoulli, count trials until r successesSource: Sales
🧬Trials until the 10th mutation in genetics — rare events (small p) mean many trialsSource: Genetics
🏥Patients until 4th recovery in a clinical trial — negative binomial for "r successes"Source: Clinical trials
🎰Slot machine plays until 2nd jackpot — geometric is r=1, this generalizes to any rSource: Gaming

How It Works

Trials Until r-th Success

Independent Bernoulli trials (success prob p). Count total trials X until exactly r successes. X ≥ r always.

Combinatorial Factor

C(k-1, r-1) counts ways to arrange r-1 successes among first k-1 trials, with k-th trial being r-th success.

Geometric as Special Case

When r=1, we get geometric — trials until first success. C(k-1,0)=1, so P(X=k) = (1-p)^(k-1) × p.

Mean and Variance

Mean = r/p (expected trials). Variance = r(1-p)/p². Lower p → more trials; higher r → more trials.

Normal Approximation

When r is large, X ≈ normal with mean r/p and variance r(1-p)/p².

Expert Tips

NegBin vs Binomial

Binomial: fixed n trials, count successes. NegBin: fixed r successes, count trials.

Overdispersion

NegBin used when data is overdispersed (variance > mean) vs Poisson.

r=1 is Geometric

Geometric is the special case — use for "first success" only.

Alternative Parameterization

Some texts use "failures before r successes" — different but related formulation.

Distribution Comparison

DistributionWhat we countFixedParameters
BinomialSuccesses in n trialsn (trials)n, p
Negative BinomialTrials until r successesr (successes)r, p
GeometricTrials until 1st successr=1p

Frequently Asked Questions

Binomial vs negative binomial?

Binomial: fixed n trials, count successes. Negative binomial: fixed r successes, count trials until we get them.

When is r=1?

r=1 gives the geometric distribution — trials until the first success. It's the special case of negative binomial.

Why "negative" binomial?

The name comes from the generalized binomial coefficient C(-r, k) in an alternative formulation. Models "waiting" for r successes.

What does mean r/p mean?

Expected trials to get r successes. If p=0.5, expect 2 trials per success, so r successes need ~2r trials on average.

When can I use normal approximation?

When r is large (e.g., r ≥ 10), distribution ≈ normal with mean r/p and variance r(1-p)/p².

How to interpret P(X=k)?

Probability that exactly k trials are needed to achieve the r-th success. (k-1)th trial had r-1 successes, k-th is r-th.

Can p be 0 or 1?

No. p=0 means no success ever; p=1 means X=r always. Formulas assume 0 < p < 1.

"Number of failures" parameterization?

Y = X - r = failures before r successes. P(Y=f) = C(f+r-1, f) p^r (1-p)^f. Same distribution, different framing.

Negative Binomial by the Numbers

r/p
Mean (trials)
r(1-p)/p²
Variance
r=1
Geometric
k ≥ r
Support

Disclaimer: This calculator provides negative binomial probabilities for educational and professional reference. Assumes independent Bernoulli trials with constant p. Verify against established statistical software for critical applications.

👈 START HERE
⬅️Jump in and explore the concept!
AI

Related Calculators