# 24. Determinants

## 24. Determinants

### Definition

We saw that a 2-by-2 matrix $\begin{pmatrix}a&b\\ c&d\end{pmatrix}$ has an inverse if and only if $ad-bc\neq 0$ . This condition generalises to bigger matrices as follows. To each $n$ -by-$n$ matrix $M$ , we will define a number $\det(M)$ (the determinant of $M$ ) such that $M$ has an inverse if and only if $\det(M)\neq 0$ .

Definition:

Let $M$ be an $n$ -by-$n$ matrix. The number $\det(M)$ is defined as follows.

• Pick an entry from each row in such a way that no two of your choices are in the same column. (If $M$ were 2-by-2 then you could either pick $a$ and $d$ or $b$ and $c$ ).

• Multiply your chosen entries together (if $M$ were 2-by-2 this would give us $ad$ or $bc$ ).

• Do the same for every other choice you could have made, and add up the results with signs (I'll explain the signs later). (If $M$ were 2-by-2, we would get $\pm ad\pm bc$ ).

Before we explain the signs, let's see how many choices there would be if $n=3$ , so $M=\begin{pmatrix}M_{11}&M_{12}&M_{13}\\ M_{21}&M_{22}&M_{23}\\ M_{31}&M_{32}&M_{33}\end{pmatrix}.$ If you pick $M_{11}$ from the top row, you can't pick anything in the first column for your other choices, so the only possibilities are $M_{22},M_{33}$ or $M_{23},M_{32}$ from the second and third rows. In this way, the possible choices give: $M_{11}M_{22}M_{33},\qquad M_{11}M_{23}M_{32},\qquad M_{12}M_{21}M_{33},\qquad M% _{12}M_{23}M_{31},\qquad M_{13}M_{21}M_{32},\qquad M_{13}M_{22}M_{31},$ so there are six possibilities.

More generally:

Lemma:

Let $M$ be an $n$ -by-$n$ matrix. The number of ways of choosing something from each row so that no two are in the same column is $n!$ .

For each choice, write down the column numbers in the order you chose them. For example:

• $M_{11}M_{22}M_{33}$ corresponds to choosing entry 1 from row 1, entry 2 from row 2 and entry 3 from row 3, so you'd write down $123$ ;

• $M_{11}M_{23}M_{32}$ corresponds to choosing entry 1 from row 1, entry 3 from row 2 and entry 2 from row 3, so you'd write down $132$ .

This gives a permutation of $1,2,\ldots,n$ . Every permutation arises and a choice is determined by the permutation you wrote down, so the number of choices is the same as the number of permutations, which is $n!$ .

### Signs

Having made a choice as above and written down the corresponding permutation of $1,2,\ldots,n$ , the sign you assign to this choice is:

• $+1$ if your permutation is even (i.e. can be written as an even number of transpositions);

• $-1$ if your permutation is odd (i.e. can be written as an odd number of transpositions).

Suppose you picked $M_{11}M_{22}M_{33}$ , corresponding to the permutation $123$ . To get from $123$ back to $123$ , I don't have to do anything (i.e. 0 transpositions) and 0 is an even number so this is an even permutation, and $M_{11}M_{22}M_{33}$ contributes with a plus sign to the determinant.

Suppose you picked $M_{11}M_{23}M_{32}$ corresponding to the permutation $132$ . To get from $132$ back to $123$ you need to transpose $2$ and $3$ , so that's one transposition, and the permutation is odd. Therefore $M_{11}M_{23}M_{32}$ contributes with a minus sign.

Here are the permutations and signs for the other choices when $n=3$ :

ProductPermutationSign
$M_{11}M_{22}M_{33}$ $123$ $+$
$M_{11}M_{23}M_{32}$ $132$ $-$
$M_{12}M_{21}M_{33}$ $213$ $-$
$M_{12}M_{23}M_{31}$ $231$ $+$
$M_{13}M_{21}M_{32}$ $312$ $+$
$M_{13}M_{22}M_{31}$ $321$ $-$

so $\det(M)=M_{11}M_{22}M_{33}-M_{11}M_{23}M_{32}-M_{12}M_{21}M_{33}+M_{12}M_{23}M% _{31}+M_{13}M_{21}M_{32}-M_{13}M_{22}M_{31}.$

If $M=\begin{pmatrix}a&b\\ c&d\end{pmatrix}$ then our two choices are $ad$ (permutation $12$ , even so plus sign) and $bc$ (permutation $21$ , odd so minus sign), giving $\det(M)=ad-bc.$

### Index notation

We have a nice formula in index notation: $\det(M)=\sum_{\sigma\in S_{n}}\mathrm{sgn}(\sigma)M_{1\sigma(1)}M_{2\sigma(2)}% \cdots M_{n\sigma(n)}.$ Here:

• the sum is over all permutations $\sigma$ of $1,2,\ldots,n$

• $\mathrm{sgn}(\sigma)$ means the sign ($+1$ if $\sigma$ is even, $-1$ if $\sigma$ is odd).

• to understand the product, note that $M_{1\sigma(1)}$ is the choice from the first row (which is why the first index is 1) and it lives in column $\sigma(1)$ (remember $\sigma$ is the permutation which tells us which column our choices live in). Similarly, $M_{2\sigma(2)}$ is the choice from the second row, etc.

### Examples

Let $M=\begin{pmatrix}0&0&1\\ 0&1&0\\ 1&0&0\end{pmatrix}$ . There's only one valid choice which doesn't involve any zeros, namely $M_{31}M_{22}M_{13}=1\times 1\times 1$ . This corresponds to the permutation $321$ . To get back to $123$ we'd have to transpose $1$ and $3$ , which is an odd number of transpositions, so it has a minus sign. Therefore $\det(M)=-1$ .

Remark:

To get back from $321$ to $123$ , we could also have flipped $2$ and $3$ (getting to $231$ ) then $1$ and $3$ (getting to $213$ ) then $1$ and $2$ (getting to $123$ ). This would have been three transpositions, which is still an odd number. The reason the definition of odd vs even permutations makes sense is that any permutation can be written as either an odd number of transpositions or an even number, but never as both. We won't prove that here.

Let $B=\begin{pmatrix}5&0&0\\ 0&1&0\\ 0&0&3\end{pmatrix}$ . Again, there's only one valid choice which has no zeros, and this choice corresponds to the permutation $123$ , so the only contribution to the determinant is $+5\times 1\times 3=15$ . Therefore $\det(B)=15$ .

This applies to any diagonal matrix, i.e. a matrix whose off-diagonal entries are all zero: the determinant is the product of diagonal entries (with no extra signs).

Consider an upper triangular matrix (where all entries strictly below the diagonal are zero) like $C=\begin{pmatrix}1&2&3\\ 0&1&2\\ 0&0&1\end{pmatrix}.$ From the last row you have to pick the last entry. Therefore from the penultimate row you have to pick the penultimate entry, and so on, and you end up being forced to pick only the diagonal entries. So you get the product of diagonal entries with no extra sign (in this example, $\det(C)=1$ ).

Since the elementary matrix $E_{ij}(\lambda)=\begin{pmatrix}1&0&\cdots&&\\ 0&\ddots&&\lambda&\\ \vdots&&1&&\vdots\\ &&&\ddots&0\\ &&\cdots&0&1\end{pmatrix}$ is upper triangular (if $i , or lower triangular if $i>j$ ), and has all its diagonal entries equal to $1$ , we see that $\det(E_{ij}(\lambda))=1$ .

Since the elementary matrix $E_{i}(\lambda)=\begin{pmatrix}1&0&\cdots&&\\ 0&\ddots&&&\\ \vdots&&\lambda&&\vdots\\ &&&\ddots&0\\ &&\cdots&0&1\end{pmatrix}$ is a diagonal matrix with all diagonal entries $1$ except one which is $\lambda$ , we get $\det(E_{i}(\lambda))=\lambda$ .