How to use this calculator
Calculate the probability of encountering a specified number of failures before the rth success when drawing without replacement.
- Enter Total finite population, Success items in population, Success number that stops drawing, Failures before stopping. Match the units shown beside each field and review the result together with the assumptions below.
- Read the worked example below to check the expected input format and result.
- Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
Negative hypergeometric stopping draw probability explained
Use Total finite population with Success items in population to reproduce the sample calculation, then review the stated limits before carrying the result into another scenario.
A numerical walkthrough
Total finite population = 30; Success items in population = 8; Success number that stops drawing = 3; Failures before stopping = 5.
- Probability of exactly f failures before rth success: 0.0944850652
- Expected failures before stopping: 7.33333333 failures
- Expected stopping draw: 10.33333333 draws
Stop at the third success from eight successes in thirty items. Five failures before that success place the stopping event on draw eight.
The model behind the numbers
P(F=f)=C(f+r−1,f)C(N−r−f,K−r)/C(N,K); E(F)=r(N−K)/(K+1).
The last draw must be a success. Before it, f failures and r−1 successes may appear in any order; the remaining population fills the rest of the random ordering. Unlike a negative binomial model, success chances change as items are removed.
What to enter
N— Total finite population- Total number of success and failure items in the finite population. Enter a whole number.
K— Success items in population- Number of success items in that population, at most N. Enter a whole number.
r— Success number that stops drawing- The rth success ends drawing. It must be at least one and no larger than available successes K. Enter a whole number.
f— Failures before stopping- Requested failure count before the stopping success. The stopping draw itself is not counted as a failure. Enter a whole number.
Interpreting the result
Uniform random sampling without replacement, 1≤r≤K≤N, and 0≤f≤N−K. Counts are integers. The result is a stopping-count probability, not the probability of a fixed-size sample composition.
Reading the outputs
Expected stopping draw is r plus expected failures. The probability input f refers only to failures, so it must not include the stopping success.
Frequently asked questions
How is this different from negative binomial?
Negative binomial assumes independent trials with fixed success probability; this uses a shrinking finite population.
What if every item is a success?
There are zero failures and stopping occurs exactly on draw r.
Can I stop at the last success?
Yes. Set r=K, provided all other constraints hold.
How do I use the Negative hypergeometric stopping draw probability calculator?
Enter Total finite population, Success items in population, Success number that stops drawing, Failures before stopping. Match the units shown beside each field and review the result together with the assumptions below.
What is a worked example of Negative hypergeometric stopping draw probability?
Total finite population = 30; Success items in population = 8; Success number that stops drawing = 3; Failures before stopping = 5. Probability of exactly f failures before rth success: 0.0944850652 Expected failures before stopping: 7.33333333 failures Expected stopping draw: 10.33333333 draws Stop at the third success from eight successes in thirty items. Five failures before that success place the stopping event on draw eight.
Method reference: SciPy statistical function reference.
Read our calculation methodology.