Parity of a permutation
![](https://upload.wikimedia.org/wikipedia/commons/thumb/3/3d/Symmetric_group_4%3B_permutation_list.svg/220px-Symmetric_group_4%3B_permutation_list.svg.png)
Odd permutations have a green or orange background. The numbers in the right column are the inversion numbers (sequence A034968 in the OEIS), 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 of X can be defined as the parity of the number of inversions for
The sign, signature, or signum of a permutation
The sign of a permutation can be explicitly expressed as
- sgn(
σ ) = (−1)N(σ )
where N(
Alternatively, the sign of a permutation
- sgn(
σ ) = (−1)m
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.[1]
Example
[edit]Consider the permutation
There are many other ways of writing
σ = (1 5)(3 4)(2 4)(1 2)(2 3),
but it is impossible to write it as a product of an even number of transpositions.
Properties
[edit]The identity permutation is an even permutation.[1] An even permutation can be obtained as the composition of an even number (and only an even number) of exchanges (called transpositions) of two elements, while an odd permutation can be obtained by (only) an odd number of transpositions.
The following rules follow directly from the corresponding rules about addition of integers:[1]
- the composition of two even permutations is even
- the composition of two odd permutations is even
- the composition of an odd and an even permutation is odd
From these it follows that
- the inverse of every even permutation is even
- the inverse of every odd permutation is odd
Considering the symmetric group Sn of all permutations of the set {1, ..., n}, we can conclude that the map
- sgn: Sn → {−1, 1}
that assigns to every permutation its signature is a group homomorphism.[2]
Furthermore, we see that the even permutations form a subgroup of Sn.[1] This is the alternating group on n letters, denoted by An.[3] It is the kernel of the homomorphism sgn.[4] The odd permutations cannot form a subgroup, since the composite of two odd permutations is even, but they form a coset of An (in Sn).[5]
If n > 1, then there are just as many even permutations in Sn as there are odd ones;[3] consequently, An contains n!/2 permutations. (The reason is that if
A cycle is even if and only if its length is odd. This follows from formulas like
In practice, in order to determine whether a given permutation is even or odd, one writes the permutation as a product of disjoint cycles. The permutation is odd if and only if this factorization contains an odd number of even-length cycles.
Another method for determining whether a given permutation is even or odd is to construct the corresponding permutation matrix and compute its determinant. The value of the determinant is the same as the parity of the permutation.
Every permutation of odd order must be even. The permutation (1 2)(3 4) in A4 shows that the converse is not true in general.
Equivalence of the two definitions
[edit]This section presents proofs that the parity of a permutation
- as the parity of the number of inversions in
σ (under any ordering); or - as the parity of the number of transpositions that
σ can be decomposed to (however we choose to decompose it).
Let
σ = T1 T2 ... Tk
We want to show that the parity of k is equal to the parity of the number of inversions of
Every transposition can be written as a product of an odd number of transpositions of adjacent elements, e.g.
- (2 5) = (2 3) (3 4) (4 5) (4 3) (3 2).
Generally, we can write the transposition (i i+d) on the set {1,...,i,...,i+d,...} as the composition of 2d−1 adjacent transpositions by recursion on d:
- The base case d=1 is trivial.
- In the recursive case, first rewrite (i, i+d) as (i, i+1) (i+1, i+d) (i, i+1). Then recursively rewrite (i+1, i+d) as adjacent transpositions.
If we decompose in this way each of the transpositions T1 ... Tk above, we get the new decomposition:
σ = A1 A2 ... Am
where all of the A1...Am are adjacent. Also, the parity of m is the same as that of k.
This is a fact: for all permutation
Therefore, the parity of the number of inversions of
An alternative proof uses the Vandermonde polynomial
So for instance in the case n = 3, we have
Now for a given permutation
Since the polynomial has the same factors as except for their signs, it follows that sgn(
A third approach uses the presentation of the group Sn in terms of generators
- for all i
- for all i < n − 1
- if
Recall that a pair x, y such that x < y and
Similarly, the count of inversions j gained also has the same parity as n. Therefore, the count of inversions gained by both combined has the same parity as 2n or 0. Now if we count the inversions gained (or lost) by swapping the ith and the jth element, we can see that this swap changes the parity of the count of inversions, since we also add (or subtract) 1 to the number of inversions gained (or lost) for the pair (i,j).
Note that initially when no swap is applied, the count of inversions is 0. Now we obtain equivalence of the two definitions of parity of a permutation.Consider the elements that are sandwiched by the two elements of a transposition. Each one lies completely above, completely below, or in between the two transposition elements.
An element that is either completely above or completely below contributes nothing to the inversion count when the transposition is applied. Elements in-between contribute .
As the transposition itself supplies inversion, and all others supply 0 (mod 2) inversions, a transposition changes the parity of the number of inversions.Other definitions and proofs
[edit]The parity of a permutation of points is also encoded in its cycle structure.
Let
so call k the size of the cycle, and observe that, under this definition, transpositions are cycles of size 1. From a decomposition into m disjoint cycles we can obtain a decomposition of
if we take care to include the fixed points of
Suppose a transposition (a b) is applied after a permutation
- ,
and if a and b are in the same cycle of
- .
In either case, it can be seen that N((a b)
If
- Remarks
- A careful examination of the above argument shows that r ≥ N(
σ ), and since any decomposition ofσ into cycles whose sizes sum to r can be expressed as a composition of r transpositions, the number N(σ ) is the minimum possible sum of the sizes of the cycles in a decomposition ofσ , including the cases in which all cycles are transpositions. - This proof does not introduce a (possibly arbitrary) order into the set of points on which
σ acts.
Generalizations
[edit]Parity can be generalized to Coxeter groups: one defines a length function ℓ(v), which depends on a choice of generators (for the symmetric group, adjacent transpositions), and then the function v ↦ (−1)ℓ(v) gives a generalized sign map.
See also
[edit]- The fifteen puzzle is a classic application
- Zolotarev's lemma
Notes
[edit]References
[edit]- Weisstein, Eric W. "Even Permutation". MathWorld.
- Jacobson, Nathan (2009). Basic algebra. Vol. 1 (2nd ed.). Dover. ISBN 978-0-486-47189-1.
- Rotman, J.J. (1995). An introduction to the theory of groups. Graduate texts in mathematics. Springer-Verlag. ISBN 978-0-387-94285-8.
- Goodman, Frederick M. Algebra: Abstract and Concrete. ISBN 978-0-9799142-0-1.
- Meijer, Paul Herman Ernst; Bauer, Edmond (2004). Group theory: the application to quantum mechanics. Dover classics of science and mathematics. Dover Publications. ISBN 978-0-486-43798-9.