Loading content...
When sampling from a finite population without replacement, the probability of obtaining a specific number of "special" items follows a distinct mathematical pattern known as the finite sampling distribution. This distribution is fundamentally different from binomial sampling because once an item is drawn, it cannot be selected again, making each subsequent draw dependent on previous outcomes.
Consider a population containing N total items, where K of them possess a specific characteristic (let's call them "successes"). If we randomly draw n items from this population without replacement, the probability of obtaining exactly k successes follows a precise combinatorial formula.
Mathematical Foundation:
The probability is computed using the ratio of favorable outcomes to total possible outcomes:
$$P(X = k) = \frac{\binom{K}{k} \cdot \binom{N-K}{n-k}}{\binom{N}{n}}$$
Where:
Validity Constraints:
For a valid probability calculation, k must fall within feasible bounds:
If k falls outside these bounds, the probability is 0.0 (an impossible event).
Your Task:
Write a function that computes the probability of obtaining exactly k successes when drawing n items without replacement from a population of size N containing K success items. Return the result rounded to 4 decimal places.
population_size = 52, success_count = 13, sample_size = 5, target_successes = 20.2743Imagine a standard deck of 52 playing cards with 13 hearts. Drawing 5 cards without replacement, we want the probability of getting exactly 2 hearts.
Using the formula: • Ways to choose 2 hearts from 13: C(13,2) = 78 • Ways to choose 3 non-hearts from 39: C(39,3) = 9,139 • Total ways to choose 5 cards from 52: C(52,5) = 2,598,960
P(X = 2) = (78 × 9,139) / 2,598,960 = 712,842 / 2,598,960 ≈ 0.2743
population_size = 10, success_count = 4, sample_size = 3, target_successes = 10.5From a small group of 10 items where 4 are marked as special, we draw 3 items and want exactly 1 to be special.
• Ways to choose 1 special from 4: C(4,1) = 4 • Ways to choose 2 regular from 6: C(6,2) = 15 • Total ways to choose 3 from 10: C(10,3) = 120
P(X = 1) = (4 × 15) / 120 = 60 / 120 = 0.5
population_size = 20, success_count = 5, sample_size = 6, target_successes = 20.3522From a population of 20 items with 5 success items, drawing 6 items without replacement and seeking exactly 2 successes.
• Ways to choose 2 successes from 5: C(5,2) = 10 • Ways to choose 4 non-successes from 15: C(15,4) = 1,365 • Total ways to choose 6 from 20: C(20,6) = 38,760
P(X = 2) = (10 × 1,365) / 38,760 = 13,650 / 38,760 ≈ 0.3522
Constraints