Premium problem32. At Least Two From the Group

Hard Locked

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)(N−gr−j)(Nr)P(\text{exactly } j) = \frac{\binom{g}{j}\binom{N-g}{r-j}}{\binom{N}{r}} P(≥2)=1−P(0)−P(1)P(\ge 2) = 1 - P(0) - P(1)

Input

deck_size = 52
group_size = 4
draw = 5

Output

0.041684366054113964

Premium problem

This one's part of Premium. Unlock the full Probability track plus every other premium problem on the site.

Implement solve(...)