jax.scipy.special.comb#
- jax.scipy.special.comb(N, k, *, repetition=False)[source]#
The number of combinations of N things taken k at a time (“N choose k”).
JAX implementation of
scipy.special.comb().\[\mathrm{comb}(N, k) = \binom{N}{k} = \frac{N!}{k!\,(N - k)!}\]- Parameters:
N (ArrayLike) – arraylike, number of things.
k (ArrayLike) – arraylike, number of elements taken.
repetition (bool) – bool, compute the number of combinations with repetition.
- Returns:
array containing the total number of combinations.
- Return type:
Notes
This computes the float-valued binomial coefficient via the
gammaln()function. Theexactargument fromscipy.special.comb()is not supported because JAX does not support arbitrary-precision integers. IfN < 0,k < 0, ork > Nandrepetition=False, then 0 is returned.