In
mathematics, when
X is a
finite set of at least two elements, the
permutations of
X (i.e. the
bijective functions from
X to
X) fall into two classes of equal size: the
even permutations and the
odd permutations. If any
total ordering of
X is fixed, the
parity (
oddness or
evenness) of a permutation
of
X can be defined as the parity of the number of
inversions for s, i.e., of pairs of elements of
X such that
and
.