**7.7 LU Redux**

**8.1.2 Permutations**

Considernobjects labeled 1 throughn and shuffle them. Each possible shuf- fle is called apermutation. For example, here is an example of a permutation of 1–5: σ= 1 2 3 4 5 4 2 5 1 3

8.1 The Determinant Formula 171

We can consider a permutation σ as an invertible function from the set of numbers [n] := {1,2, . . . , n} to [n], so can write σ(3) = 5 in the above example. In general we can write

_{1} _{2} _{3} _{4} _{5}

σ(1) σ(2) σ(3) σ(4) σ(5)

,

but since the top line of any permutation is always the same, we can omit it and just write:

σ=σ(1) σ(2) σ(3) σ(4) σ(5) and so our example becomes simply σ = [4 2 5 1 3].

The mathematics of permutations is extensive; there are a few key prop- erties of permutations that we’ll need:

• There aren! permutations ofndistinct objects, since there arenchoices for the first object, n−1 choices for the second once the first has been chosen, and so on.

• Every permutation can be built up by successively swapping pairs of objects. For example, to build up the permutation 3 1 2 from the trivial permutation

1 2 3

, you can first swap 2 and 3, and then swap 1 and 3.

• For any given permutationσ, there is some number of swaps it takes to build up the permutation. (It’s simplest to use the minimum number of swaps, but you don’t have to: it turns out thatany way of building up the permutation from swaps will have have the same parity of swaps, either even or odd.) If this number happens to be even, then σ is called an even permutation; if this number is odd, then σ is an odd permutation. In fact, n! is even for all n ≥ 2, and exactly half of the permutations are even and the other half are odd. It’s worth noting that the trivial permutation (which sends i→i for every i) is an even permutation, since it uses zero swaps.

Definition The sign function is a function sgn that sends permutations to the set {−1,1} with rule of correspondence defined by

sgn(σ) =

1 if σ is even −1 if σ is odd.

### Permutation Example

Reading homework: problem 1

We can use permutations to give a definition of the determinant. Definition The determinantof n×n matrix M is

### detM

### =

### P

σ### sgn(σ)m

1 σ(1)### m

2 σ(2)### · · ·m

n σ(n)### .

The sum is over all permutations of n objects; a sum over the all elements of {σ : {1, . . . , n} → {1, . . . , n}}. Each summand is a product of n entries from the matrix with each factor from a different row. In different terms of the sum the column numbers are shuffled by different permutations σ.

The last statement about the summands yields a nice property of the determinant:

Theorem 8.1.1. If M = (mi_{j}) has a row consisting entirely of zeros, then

mi

σ(i) = 0 for every σ and some i. Moreover detM = 0.

Example 102 Because there are many permutations of n, writing the determinant this way for a general matrix gives a very long sum. For n = 4, there are 24 = 4!

permutations, and forn= 5, there are already 120 = 5!permutations.

For a4×4matrix, M =
m1_{1} m1_{2} m1_{3} m1_{4}
m2_{1} m2_{2} m2_{3} m2_{4}
m3_{1} m3_{2} m3_{3} m3_{4}
m4_{1} m4_{2} m4_{3} m4_{4}

, then detM is:

detM = m1_{1}m2_{2}m3_{3}m4_{4}−m1_{1}m2_{3}m3_{2}m4_{4}−m_{1}1m2_{2}m3_{4}m4_{3}

− m1_{2}m2_{1}m_{3}3m4_{4}+m1_{1}m_{3}2m3_{4}m4_{2}+m_{1}1m2_{4}m3_{2}m4_{3}
+ m1_{2}m2_{3}m3_{1}m4_{4}+m1_{2}m2_{1}m3_{4}m4_{3}±16 more terms.

8.1 The Determinant Formula 173

This is very cumbersome.

Luckily, it is very easy to compute the determinants of certain matrices. For example, if M is diagonal, meaning that Mi

j = 0 whenever i 6= j, then all summands of the determinant involving off-diagonal entries vanish and

detM =X σ

sgn(σ)m1_{σ}_{(1)}m2_{σ}_{(2)}· · ·mn_{σ}_{(}_{n}_{)} =m1_{1}m2_{2}· · ·mn_{n}.

The determinant of a diagonal matrix is the product of its diagonal entries.

Since the identity matrix is diagonal with all diagonal entries equal to one, we have

detI = 1.

We would like to use the determinant to decide whether a matrix is in- vertible. Previously, we computed the inverse of a matrix by applying row operations. Therefore we ask what happens to the determinant when row operations are applied to a matrix.

Swapping rows Lets swap rowsiandjof a matrixM and then compute its determi- nant. For the permutationσ, letσˆ be the permutation obtained by swapping positions

iand j. Clearly

sgn(ˆσ) =−sgn(σ).

Let M0 be the matrixM with rowsi andj swapped. Then (assuming i < j):

detM0 = X
σ
sgn(σ)m1_{σ}_{(1)}· · ·mj_{σ}_{(}_{i}_{)}· · ·mi_{σ}_{(}_{j}_{)}· · ·mn_{σ}_{(}_{n}_{)}
= X
σ
sgn(σ)m1_{σ}_{(1)}· · ·mi_{σ}_{(}_{j}_{)}· · ·mj_{σ}_{(}_{i}_{)}· · ·mn_{σ}_{(}_{n}_{)}
= X
σ
(−sgn(ˆσ))m_{σ}_{ˆ}1_{(1)}· · ·mi_{σ}_{ˆ}_{(}_{i}_{)}· · ·mj_{ˆ}_{σ}_{(}_{j}_{)}· · ·mn_{ˆ}_{σ}_{(}_{n}_{)}
= −X
ˆ
σ
sgn(ˆσ)m1_{σ}_{ˆ}_{(1)}· · ·mi_{σ}_{ˆ}_{(}_{i}_{)}· · ·mj_{σ}_{ˆ}_{(}_{j}_{)}· · ·mn_{σ}_{ˆ}_{(}_{n}_{)}
= −detM.

The step replacing P σ by

P ˆ

σ often causes confusion; it holds since we sum over all

permutations (see review problem 3). Thus we see that swapping rows changes the sign of the determinant. I.e.,

Figure 8.2: Remember what row swap does to determinants!

Reading homework: problem 8.2

Applying this result to M =I (the identity matrix) yields

detEi_{j} =−1,

where the matrixE_{j}i is the identity matrix with rowsiandjswapped. It is a row swap
elementary matrix.

This implies another nice property of the determinant. If two rows of the matrix are identical, then swapping the rows changes the sign of the matrix, but leaves the matrix unchanged. Then we see the following:

Theorem 8.1.2. If M has two identical rows, thendetM = 0.