Negative Binomial Distribution Calculator
Enter r successes, probability p and k failures.
Result
How it is calculated
The tool gives the probability of exactly k failures before the r-th success in independent trials with the same success probability: P(X = k) = C(k + r − 1, k) × pr × (1 − p)k. Here r is the number of successes you wait for, p is the success probability of one trial as a number from 0 to 1, k is the number of failures, and C(n, m) counts the ways to place the k failures among the trials before the last success. The mean number of failures is r (1 − p) / p and the variance is r (1 − p) / p². The probability is shown to four decimals, mean and variance to two. The tool requires r to be a whole number of at least 1, k a whole number of at least 0, and p above 0 and at most 1. With p = 1 there are never any failures, so k = 0 gives 1.0000. The answer is for exactly k failures, not for k or fewer.
Worked example
A player needs 5 successes, and each attempt succeeds with probability 0.6. What is the chance of exactly 3 failures before the 5th success? C(3 + 5 − 1, 3) = C(7, 3) = 35. p5 = 0.65 = 0.07776. (1 − p)3 = 0.43 = 0.064. Probability = 35 × 0.07776 × 0.064 = 0.1742. Mean failures = 5 × 0.4 / 0.6 = 3.33, and variance = 5 × 0.4 / 0.36 = 5.56. So exactly 3 failures happens about 17.4% of the time.
Common mistakes
- Entering p as a percentage, such as 60 for 60%. The field is a probability between 0 and 1, so type 0.6; 60 gives no result.
- Entering the number of trials as k. The tool counts failures; with 5 successes and 3 failures, the total number of trials is 8.
- Reading P(X = k) as the chance of at most k failures. It is the chance of exactly k; add the values for k = 0, 1, 2, … for a cumulative figure.
- Mixing up r and k. The r field is the number of successes you wait for (at least 1), while k can be 0.
- Expecting the mean to be the number of trials. The mean is the average number of failures,
r (1 − p) / p, which here is 3.33; the average number of trials would be that plus r.
About this calculator
The negative binomial distribution models the number of failures that occur before a fixed number of successes, r, is reached in a sequence of independent trials each with success probability p — for example, how many times you would expect to miss a free throw before making your 5th successful one. Its mean is r(1−p)/p and its variance is r(1−p)/p², and setting r = 1 reduces it to the simpler geometric distribution, which just counts failures before the first success.
It differs from the ordinary binomial distribution in what is held fixed: binomial fixes the number of trials and counts successes, while negative binomial fixes the number of successes and counts trials (or failures) needed to get there. Beyond coin-flip style examples, the distribution is widely used in reliability engineering to model the number of failures before a set number of successful units, in sports analytics for streaks, and in ecology and epidemiology to model overdispersed count data — counts with more variance than a plain Poisson distribution would predict, such as disease case counts across regions.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
- Loan Calculator
- Profit Calculator
- Discount Calculator
- BMI Calculator
- Percentage Calculator
- Ideal Weight Calculator
- Age Calculator
- Pregnancy Due Date Calculator
- Compound Interest Calculator
- BMR Calculator (Basal Metabolic Rate)
- Tip Calculator
- Fuel Cost Calculator
- Date Difference Calculator
- Sleep Cycle Calculator
- Daily Water Intake Calculator
- Simple Interest Calculator
- Heart Rate Zones Calculator
- Running Pace Calculator
- Pet Age Calculator
- Calories Burned Calculator
- Macro Calculator
- TDEE Calculator (Total Daily Energy Expenditure)
- Waist-to-Hip Ratio Calculator
- Honor Roll Calculator
- One Rep Max (1RM) Calculator
- Ovulation Calculator
- Electricity Cost Calculator
- Unit Price Calculator
- Savings Goal Calculator
- Break-Even Point Calculator
- Paint Calculator
- Course Grade Average Calculator
- Business Days Calculator
- Time Duration Calculator
- Fuel Economy Calculator
- Temperature Converter
- Tile Calculator
- Aspect Ratio Calculator
- Roman Numeral Converter
- Goal Weight Timeline Calculator
- Salary Converter (Hourly to Annual)
- Credit Card Validator (Luhn)
- Body Surface Area (BSA) Calculator
- Feels-Like Temperature Calculator
- Ohm’s Law Calculator
- PPI (Pixel Density) Calculator
- Molar Mass Calculator
- Zodiac Sign Calculator (Western + Chinese)
- IBAN Validator
- Shoe Size Converter
- Country Info & Dialing Code Lookup
- Time Zone Difference (World Clock)
- CAGR (Compound Annual Growth Rate) Calculator
- Rule of 72 Calculator
- Blood Alcohol Content (BAC) Calculator
- Lean Body Mass (LBM) Calculator
- Pythagorean Theorem Calculator
- Speed Converter
- Download Time Calculator
- Date Calculator (Add/Subtract)
No calculators found
Comments