<<

Permutations

A permutation is a reordering of the integers in the Sn = {1, 2, . . ., n} For example, there are 6 permutation of the set S3: 1 2 3 1 3 2 2 1 3 2 3 1 3 1 2 3 2 1 In general there are n! = n (n-1) (n-2) . . . 3 2 1 permutations of the set Sn

To define of matrices we need to define inversions of a permutation. Roughly, this counts how far a permutation is from the natural ordering. A permutation has an inversion whenever any larger element precedes a smaller one. For example, look at this permutation on S8 : Inversions 2 1 4 5 8 7 3 6 1 + 0 + 1 + 1 + 3 + 2 + 0 + 0 = 8 2 has 1 smaller element after it, 1 has 0, 4 has 1, 5 has 1, 8 has 3, 7 has 2, 3 has 0 and 6 has 0 A permutation is called even or odd, depending or whether the sum of all the inversions is even or odd. This is also known as the parity of the permutation.

A permutation can also be thought of as a one-to-one from Sn onto itself; this means every element in Sn is in the range of the function and no two elements in Sn map to the same element. Drawing arrows to represent the permutation as a function gives another way to count inversions. For example, 2 1 5 4 6 8 7 3 is shown in the diagram. The number of inversions is the number of intersections of the lines. You can count these by intersections as you draw the lines. 1 → 2, 2 → 1 and 3 → 5. One intersection and one inversion in 2 1 5. Add in 4 → 4: one intersection and one inversion added by appending 4 to 2 1 5 4. Counting inversions this way makes it clear that the inverse of a permutation has the same number of inversions – simply reverse the direction of the arrows. Check that the iinverse of 2 1 5 4 6 8 7 3 is 2 1 8 4 3 5 7 6 which also has 8 inversions.

One other basic fact needed about permutations is that swapping any two elements in a permutation changes the parity i.e. an even permutation becomes odd and vice versa. To show this, first assume that the two entries in the permutation are adjacent to each other - say the values are a and b. If a < b then swapping them adds one inversion to the permutation while if a > b swapping subtracts one inversion. In either case, the permutation will change parity. If the two elements to be switched are not adjacent, they can be swapped by making a series of adjacent swaps. Say a and b are separated by k intervening elements with a in the lower slot. . . .a i1 i2 . . . ik b . . . Move b below a by making k+1 adjacent swaps in the permutation to obtain: . . .b a i1 i2 . . . ik . . . Then move a b's original location with k adjacent swaps . . .b i1 i2 . . . ik a . . . The total number of adjacent swaps required is 2k + 1, an odd number, so the parity is switchd an odd number of times and ends up different from the original parity.