def pick_Q(N, M, Q):
    """
    Given a deck of N cards, where M are marked,
    and Q cards are taken randomly without replacement,
    return the probability that at least one marked card is taken.
    """
return scipy.stats.hypergeom.sf(0, N, M, Q)
Вытягивание карт из колоды в SciPy с помощью scipy.stats.hypergeom