I have a shuffled deck of $d$ cards containing $g$ “good” cards. I'm going to draw a hand of $h$ cards (without replacement) and I want it to contain exactly $w$ good cards. (Change the variables if there's a standard notation.) What is the probability of drawing a hand with the cards I want?

I feel like I knew a general solution to this in high school, but I can't find it now. (I can find some specific solutions, like this one.)

What I've got is this:

$$\frac{\binom{g}{w} \cdot \binom{d-g}{h-w}}{\binom{d}{h}} = \frac{\frac{g!}{w! \cdot (g-w)!} \cdot \frac{(d-g)!}{(h-w)! \cdot ((d-g)-(h-w))!}}{\frac{d!}{h! \cdot (d-h)!}} = \frac{g! \cdot (d-g)! \cdot h! \cdot (d-h)!}{w! \cdot (g-w)! \cdot (h-w)! \cdot (d-g-h+w)! \cdot d!}$$

which is way more complicated than I expected, but is giving the answers I expect.
E.g.: Draw 5 cards from a standard deck and want all 4 aces:

$$\frac{\binom{4}{4} \cdot \binom{52-4}{5-4}}{\binom{52}{5}} = 0.000018$$

Am I missing something? Is there an easier way? Is there at least a simpler simplification?

In case that's the end of that question, bonus question!
If I deal a hand like this to $p$ players, what is the probability that one (or at least one) of them gets a qualifying hand?

  • 3
    $\begingroup$ This is called the Hypergeometric Distribution. And that is as simple as it gets. $\endgroup$ – Graham Kemp Feb 14 at 23:23
  • $\begingroup$ Well, at least I know what to google now. $\endgroup$ – P1h3r1e3d13 Feb 14 at 23:36

$w$ is the count of favored items in a sample of size $h$ selected without bias from a population of size $d$ containing $g$ favoured items.   The disribution for this is known as the Hypergeometric Distribution.   It does not get any easier than this.

Well, the probability for selecting $w$ from $g$ cards when drawing $h$ from $d$ cards equals the probability for putting $w$ of the good cards into $h$ special places when sorting all $g$ good cards among $d$ positions.   But that other way of viewing the task is not any simpler to evaluate.

$$\dfrac{\dbinom gw\dbinom{d-g}{h-w}}{\dbinom dh}=\dfrac{\dbinom{h}{w}\dbinom{d-h}{g-w}}{\dbinom dg}$$

The task might be laborious by hand, but scientific calculators (devices or apps) usually provide a binomial function.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.