thumb|Permutations of 4 elements<br><br>Odd permutations have a green or orange background. The numbers in the right column are the [[Inversion (discrete mathematics)|inversion numbers , which have the same parity as the permutation.]]
In mathematics, when X is a finite set with 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 <math>\sigma</math> of X can be defined as the parity of the number of inversions for σ, i.e., of pairs of elements x, y of X such that and .
The sign, signature, or signum of a permutation σ is denoted sgn(σ) and defined as +1 if σ is even and −1 if σ is odd. The signature defines the alternating character of the symmetric group S<sub>n</sub>. Another notation for the sign of a permutation is given by the more general Levi-Civita symbol (ε<sub>σ</sub>), which is defined for all maps from X to X, and has value zero for non-bijective maps.
The sign of a permutation can be explicitly expressed as
:<!-- do not use <math> here. see https://bugzilla.wikimedia.org/show_bug.cgi?id=1594#c4 -->
where N(σ) is the number of inversions in σ.
Alternatively, the sign of a permutation σ can be defined from its decomposition into the product of transpositions as
:<!-- do not use <math> here. see https://bugzilla.wikimedia.org/show_bug.cgi?id=1594#c4 -->
where m is the number of transpositions in the decomposition. Although such a decomposition is not unique, the parity of the number of transpositions in all decompositions is the same, implying that the sign of a permutation is well-defined.
Example
Consider the permutation σ of the set defined by <math>\sigma(1) = 3,</math> <math>\sigma(2) = 4,</math> <math>\sigma(3) = 5,</math> <math>\sigma(4) = 2,</math> and <math>\sigma(5) = 1.</math> In one-line notation, this permutation is denoted 34521. It can be obtained from the identity permutation 12345 by three transpositions: first exchange the numbers 2 and 4, then exchange 3 and 5, and finally exchange 1 and 3. This shows that the given permutation σ is odd. Following the method of the cycle notation article, this could be written, composing from right to left, as
: <math>\sigma=\begin{pmatrix}1&2&3&4&5\\
3&4&5&2&1\end{pmatrix} = \begin{pmatrix}1&3&5\end{pmatrix} \begin{pmatrix}2&4\end{pmatrix} = \begin{pmatrix}1&3\end{pmatrix} \begin{pmatrix}3&5\end{pmatrix} \begin{pmatrix}2&4\end{pmatrix} .</math>
There are many other ways of writing σ as a composition of transpositions, for instance
:,
but it is impossible to write it as a product of an even number of transpositions.
Properties
The identity permutation is an even permutation.
Furthermore, we see that the even permutations form a subgroup of S<sub>n</sub>. It is the kernel of the homomorphism sgn. The odd permutations cannot form a subgroup, since the composite of two odd permutations is even, but they form a coset of A<sub>n</sub> (in S<sub>n</sub>).
If , then there are just as many even permutations in S<sub>n</sub> as there are odd ones;
