[][src]Module flag_algebra::combinatorics

Basic combinatorial functions.

In this page, [n] denotes the set {0,1,...,n-1}.

Functions from [n] to [k] are represented by a vector of length n. This in particular holds for permutations.

Functions

binomial

Returns the number of subsets of size k of a set of size n.

factorial

Returns the product of integers up to the given number.

invert

Inverts a permutation.

permutation_of_injection

Assuming t is an injection from [k] to [n], returns the unique bijection of [n] that is equal to t on [k] and is increasing on {k,k+1,.., n-1}.

pre_image

Computes the antecedents of the elements of [n] by t. The output is a vector u of size n, where u[i] contains every x with t[x]=i.

product

Computes the product start * ... * end.

pseudo_invert

Inverts an injection from [t.len()] to [n].