Every rearrangement of a row of cards can be made by swapping two cards at a time, and usually in many ways. Some rearrangements can be made with an even number of swaps and some with an odd number. No rearrangement can be made both ways, and the reason is a number attached to each permutation, its sign, or , which every swap reverses.
Swaps
A transposition is a -cycle : the permutation that swaps the two points and and fixes every other point.
For example, in has the table . The same transposition can be written , and swapping twice puts both points back: , so every transposition is its own inverse. A -cycle such as is not a transposition: it moves three points.
Every permutation of a finite set is a product of transpositions. More precisely, every cycle is a product of transpositions,
a product of transpositions, and the identity is the product of no transpositions.
Proof.¶
Idea. Check the formula for one cycle point by point, reading the product from the right, so that acts first. Then apply it to each cycle of a permutation.
-
The product fixes every point outside .
A point outside is fixed by every factor.
-
The product sends to .
The point goes to under the first factor , and the later factors with fix .
-
For , the product sends to .
The point is fixed by the factors with , sent to by , then sent to by , and fixed by the factors after that.
-
The product sends to , so it equals the cycle .
The point is fixed by every factor except the last, , which sends it to . With the first three steps, the product agrees with the cycle at every point.
-
Every permutation is a product of transpositions.
By Theorem 3.1.2, is a product of disjoint cycles. Replacing each cycle by its product of transpositions writes as a product of transpositions.
A -cycle
. Reading right to left: , and .
One cycle at a time
: the -cycle becomes , and the transposition stays as it is.
Not unique
The same permutation has many such products, of different lengths: , and also .
1
Which product equals ?
-
Reading right to left: , , and , which is .
-
Here acts first, so : this product is , the inverse of . The factor must be the one that acts first, on the right.
-
That pairs with the other points in numerical order, which gives . The factors follow the order of the points round the cycle: , then , then .
-
Disjoint transpositions only swap separate pairs: this product sends back to , while sends to . A cycle needs transpositions that overlap.
The sign
A rearrangement of the numbers puts some pairs of them out of order. The sign records whether the number of such pairs is even or odd.
Let . A pair of numbers in is an inversion of if . The sign of is the product over all pairs
with when . The permutation is even if , and odd if .
The swap in
Its table is , and its three factors are
The product is . The one inversion, the pair , gives the one negative factor, and the sizes and cancel.
The -cycle in
Its table is , and its factors are , and . The product is : the two inversions, and , give two negative factors.
Moving the first of four cards to the end
The card in place goes to place , and the card in each place moves to , so the move is . Its six factors are
The product is . The negative factors come from the three inversions , and : card now lies to the right of each of the cards , and , which are the three pairs out of order in the new row . So the move is odd.
1
What is the sign of ?
-
The inversions are , , and : four pairs out of order, so four negative factors, and .
-
Only one pair of neighbors, , is out of order, but every pair counts: , and are out of order too, four pairs in all.
The sign is always or : precisely, , where is the number of inversions of . Each pair gives one factor, which is negative exactly when the pair is an inversion. Up to sign, the numerators are the denominators in another order. Because is a bijection, the two-element sets run over all two-element subsets of , each exactly once, as does; so the product of the sizes equals the product of the differences , and only the minus signs remain. In particular the identity, with no inversions, is even.
Even and odd, never both
Let .
- (i) .
- (ii) Every transposition has sign .
- (iii) If is a product of transpositions, then . So an even permutation is a product of an even number of transpositions and never of an odd number, and an odd permutation is a product of an odd number of transpositions and never of an even number.
Proof.¶
Idea. In , the permutation first moves each pair to the pair , which then moves. So each factor of splits into a factor of times a factor of . Then (ii) is a count of inversions, and (iii) follows by multiplying.
-
Each factor of is unchanged if its two numbers are named in the other order. So is the product of over all two-element sets , each taken once, with and in either order.
Swapping and changes the sign of the numerator and of the denominator.
-
For , the factor of for the pair is the factor of for the pair times the factor of for the pair .
Since is injective, , so multiplying and dividing by it is allowed:
By the first step, the first fraction on the right is the factor of for the pair .
-
Multiplying over all pairs gives . This proves (i).
The second factors multiply to , by definition. In the first factors, as runs over the two-element subsets of , each once, so does , because is a bijection. By the first step, the first factors multiply to .
-
A transposition with has inversions, so its sign is . This proves (ii).
Write . The pair is an inversion, since . For each with , the pairs and are inversions, since and . Every other pair is in order. A pair of two fixed points keeps its order. A pair made of or and a point with or keeps its order too, because and lie on the same side of , so swapping them does not change which of the two numbers is larger. That makes inversions, an odd number, so by the formula .
-
If with each a transposition, then .
By (i), applied times, , and each factor is by (ii). For , , which is even.
-
So alone decides whether the number of transpositions is even or odd. This proves (iii).
If is even, then forces to be even for every product of transpositions equal to ; if is odd, forces to be odd. By Theorem 3.2.2, every permutation is a product of transpositions, so each one is a product of an even number of them or of an odd number, according to its sign, and never both.
Any one way of writing as swaps, however clumsy, settles whether every way takes an even or an odd number, so the parity of a shuffle can be found from whichever description is easiest.
Read off the cycles
is a product of three transpositions, so its sign is . Counting inversions agrees: its table has the five inversions , , , and .
Two products, one parity
and : two transpositions and four. The products differ, but both lengths are even, because is even.
One more swap
has the table and two inversions, and . One more swap gives , with one inversion, . The count changed by an odd number, and the sign from to .
Moving the top card to the bottom
In a deck of cards, move the top card to the bottom: the card in position goes to position , and the card in each position moves up to . The pairs are the inversions, so the move is odd. However the cards are swapped two at a time, this move takes an odd number of swaps.
1
What is the sign of ?
-
Following the points gives . The -cycle is a product of two transpositions and each -cycle is one, so is a product of transpositions and .
-
, because has an odd number of cycles.
does have three cycles, but the number of cycles is not the number of transpositions: the -cycle needs two of them, so there are in all.
-
, because each -cycle in it has sign .
A -cycle is a product of transpositions, not , so its sign is . Here : the -cycle is even, each -cycle is odd, and the product is even.
2
A permutation is a product of transpositions. Which of these is also true?
-
is a product of transpositions, and also of .
is even and is odd, so cannot be a product of both and transpositions: that would make both and .
-
is a product of transpositions, but not of .
The parity is fixed, the length is not. Since is odd it is never a product of transpositions, but it is a product of .
-
is a product of transpositions, but not of .
Appending to the transpositions gives with the same product. But , so every product equal to has an odd number of factors.
-
is a product of neither nor transpositions.
The number of transpositions is not fixed: appending makes . Only its parity is fixed.
3
Number the positions of the square’s corners clockwise, so that position of the clock in Example 1.1.2 is numbered . As a permutation of the positions, is the quarter turn even or odd?
-
Odd: , a product of three transpositions.
moves each corner one position clockwise, which is the -cycle , and a -cycle is a product of transpositions: .
-
Even: a rotation does not turn the square over.
Turning the square over and being an odd permutation are different things. The reflection turns it over, yet it is , which is even; the quarter turn does not, yet it is odd.
-
Even: all four corners move, and .
The sign counts transpositions, not moved points. A -cycle is a product of transpositions, so it is odd.
4
For which can the order of a row of cards be reversed by an even number of swaps? Explain your answer.
Reversing the row is the permutation , and the question is whether it is even. It reverses every pair , so it has inversions. That is even exactly when divides ; one of and is odd, so this happens exactly when divides or divides . Another route gives the same answer: the reversal is the product of the disjoint swaps , which is an even number exactly when leaves the remainder or on division by . So the reversal takes an even number of swaps for and an odd number for ; by the theorem, no reversal can be done both ways.
Builds on
- Definition 3.2.1: a 2-cycle , which swaps two points and fixes the rest
- Theorem 3.2.2: every permutation of a finite set is a product of transpositions, since
- Definition 3.2.3: , which is or : it records whether reverses an even or an odd number of pairs
Leads to
- Definition 3.3.1: , the even permutations of : a subgroup of
- Theorem 3.3.2: for , has elements: multiplying by matches the even permutations with the odd ones
- Example 4.1.4: the determinant , the sign , , reduction , and from to any group
- Theorem 15.6.2: if has distinct roots and does not have characteristic 2, the Galois group of , as a group of permutations of the roots, lies in exactly when is a square in
History
- 1750. Gabriel Cramer, in his Introduction à l’analyze des lignes courbes algébriques, gives the first rule for the sign of each term in what are now called determinants: the term’s sign is decided by whether its arrangement of indices has an even or an odd number of “derangements”.
- 1812–15. Augustin-Louis Cauchy’s memoir on functions that take only two values, equal and opposite in sign, when their variables are transposed (read in 1812, published in 1815) starts from the product of the differences of the variables, which every transposition changes in sign.