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.
solve(52, 4, 5) -> 0.03992981808107859 # at least two aces in a 5-card hand
Sign in to write and run your own code.
solve(...)