egttools.distributions.comb

comb(n: int, k: int) object

Calculates the binomial coefficient C(n, k).

The number of combinations of :param n things taken :param k at a time. This is often expressed as “N choose k”.

This method is exact and should be equivalent scipy.special.comb. However, if the outcome or any intermediary product occupies more than an uint128_t, the result will not be correct, since there will be an overflow!

Parameters
  • n (int) – size of the fixed set

  • k (int) – size of the unordered subset

Returns

The binomial coefficient C(n, k).

Return type

int