32. At Least Two From the Group

Hard

You draw draw cards from a deck of deck_size, of which group_size are special. What is the probability that at least two of the drawn cards are special?

Counting "at least two" directly means summing many cases. The complement is far shorter: at least two fails only when you draw exactly zero or exactly one.

P(exactly j)=(gj)(Ngrj)(Nr)P(\text{exactly } j) = \frac{\binom{g}{j}\binom{N-g}{r-j}}{\binom{N}{r}} P(2)=1P(0)P(1)P(\ge 2) = 1 - P(0) - P(1)
solve(52, 4, 5)  ->  0.03992981808107859     # at least two aces in a 5-card hand

Sign in to write and run your own code.

Implement solve(...)