Skip to main content

Module count

Module count 

Source
Expand description

Exact combinatorial counting functions over num_bigint::BigUint.

Constants§

MAX_BINOMIAL_INPUT
Largest effective k (min(k, n - k)) accepted by binomial_checked before CombError::LimitExceeded.
MAX_FACTORIAL_INPUT
Largest n accepted by factorial_checked before CombError::LimitExceeded.
MAX_PARTITION_INPUT
Largest n accepted by integer_partition_count_checked before CombError::LimitExceeded.

Functions§

bell_number
The Bell number B(n) = sum_k S(n, k): total partitions of an n-set.
binomial
n choose k via the multiplicative formula (0 when k > n).
binomial_checked
n choose k with an explicit ceiling on the effective loop length (min(k, n - k)).
factorial
n! (with factorial(0) == 1).
factorial_checked
n! with an explicit input ceiling (MAX_FACTORIAL_INPUT).
falling_factorial
The falling factorial n * (n-1) * ... * (n-k+1) (0 when k > n).
integer_partition_count
The partition count p(n): ways to write n as a sum of positive integers, order ignored.
integer_partition_count_checked
p(n) with an explicit input ceiling (MAX_PARTITION_INPUT).
multinomial
The multinomial coefficient (sum parts)! / prod(part!).
permutation_count
The number of k-permutations of n, nPk (0 when k > n).
stirling2
Stirling numbers of the second kind S(n, k): partitions of an n-set into k non-empty unlabeled blocks.