Determinants

In linear algebra, the determinant is a representation that assigns to each square matrix A a scalar, which we call |A|. In the case of numerical matrices, the determinant is equal to some real number.

Permutation of the entice

In order to define the determinant, we will need to know how to compute the permutation of the entice, or the permutation of the permutation. The best way to explain this is with an example. Let us have an ordered triple <1, 2, 3>, which is displayed on the triple <2, 3, 1>. Usually, in the case of permutations, we rewrite it as follows:

$$ \begin{pmatrix} 1&2&3\\ 2&3&1 \end{pmatrix} $$

Now we need to find out how many different number swaps we had to use to get the second set from the first set. We are only allowed to swap numbers next to each other. So we have the triple <1, 2, 3>. Now we swap one with two: <2, 1, 3>. Now we swap one with three: <2, 3, 1>, which gives us the permutation we're looking for. We needed two swaps to get the image. The sign of the permutation is easy to find - if the number of swaps is even, the sign is positive. If the number is odd, the sign is negative. So in our case, it is a positive sign permutation. Let's try to determine the sign of the permutation for this example:

$$ \begin{pmatrix} 4&2&3&1\\1&3&4&2 \end{pmatrix} $$

We will proceed as follows:

$$\left<4, 2, 3, 1\right> \rightarrow \left<4, 2, 1, 3\right> \rightarrow \left<4, 1, 2, 3\right> \rightarrow \left<1, 4, 2, 3\right> \rightarrow \left<1, 4, 3, 2\right> \rightarrow \left<1, 3, 4, 2\right>$$

The modification is done. We needed a total of five adjustments, so this time we got a permutation with an odd sign.

We denote the permutation by the Levi-Civit symbol:

$$ \epsilon_{i_1,…,i_n}= \begin{cases} +1 & \mbox{ If }(i_1, i_2, …, i_n) \mbox{ is an even permutation } (1{,}2,3{,}4,…, n) \\ -1 & \mbox{ If }(i_1, i_2, …, i_n) \mbox{ is an odd permutation } (1{,}2,3{,}4,…, n) \\ 0 & \mbox{ Otherwise } \end{cases}$$

Definition of the determinant

The determinant is a number; it is defined only on square matrices and is written as either det A or |A|. This number is defined as follows:

$$|A|=\sum_{i_1,\ldots,i_n}^n\epsilon_{i_1,\ldots,i_n}a_{1i_1}\cdot a_{2i_2}\cdot \ldots \cdot a_{ni_n}$$

Let's try to calculate the determinant of a square matrix of order 2×2:

$$A= \begin{pmatrix} 4&2\\ 1&3 \end{pmatrix} $$

If we substitute the specific value n = 2 into the definition , we get the following formula:

$$|A|=\sum_{i_1, i_2}^2=\epsilon_{i_1, i_2} \cdot a_{1i_1}\cdot a_{2i_2}$$

Substitute the values 1 and 2 for the values i1 and i2, in turn, giving us a total of four possibilities: a) i1 = 1, i2 = 1, b) i1 = 1, i2 = 2, c) i1 = 2, i2 = 1, d) i1 = 2, i2 = 2.

In the case of the options a) and d), we get a zero permutation because ε1,1 = 0 and ε2,2 = 0. Thus, in the sum in the formula in this step, we get zero because $0 \cdot a_{1i_1}\cdot a_{2i_2}=0$.

The remaining options are b) and c). In the case of b) i1 = 1, i2 = 2, we get: e1,2 = 1, because <1, 2> is an even permutation of <1, 2>. We get the first summand:

$$1\cdot a_{1i_1}\cdot a_{2i_2} = 1\cdot a_{11}\cdot a_{22}=4\cdot3=12$$

In the remaining case, we have i1 = 2, i2 = 1. The value of ε21 is equal to −1. We get the second addend:

$$-1\cdot a_{1i_1}\cdot a_{2i_2} = 1\cdot a_{12}\cdot a_{21}=-1\cdot2\cdot1=-2$$

Now we add all four cases of a) + b) + c) + d) and get

$$|A|=0+12-2+0=10.$$

The determinant of the matrix A is equal to ten.

We can notice that we have finally calculated the determinant of the matrix as the difference

$$|A|=a_{11} \cdot a_{22} - a_{12}\cdot a_{21}$$

This formula applies in general to any matrix of order 2×2.

Sarrus rule

Using the Sarrus rule, we calculate the determinant of a third order matrix. This determinant is a bit more complicated. So let's calculate, for example, this matrix:

$$A=\begin{pmatrix}5&3&2\\1&7&-8\\0&-2&7\end{pmatrix}$$

Now we'll proceed similarly to the second-order matrix, but for clarity we'll extend this matrix by two more rows - we'll describe the first two rows of the matrix under this matrix:

$$A'=\begin{pmatrix}5&3&2\\1&7&-8\\0&-2&7\\5&3&2\\1&7&-8\end{pmatrix}$$

The first and fourth rows of the matrix are thus the same, as are the second and fifth. Now we proceed by adding the multiples of the elements on the main diagonals and subtracting from them the sum of the multiples of the minor diagonals. After the addition we get:

$$|A|=[5 \cdot 7 \cdot 7 + 1 \cdot (-2) \cdot 2 + 0 \cdot 3 \cdot (-8)] - [2 \cdot 7 \cdot 0 + (-8) \cdot (-2) \cdot 5 + 7 \cdot 3 \cdot 1]=140$$

Properties of the determinant

  • If we multiply a row or column of the matrix A by c ≠ 0, we get the matrix A' and the following will hold for their determinants: c|A| = |A'|. Thus, if you multiply a row of the matrix by three and calculate the determinant, then the determinant of the original matrix is obtained by dividing the current result by three.

  • Multiplying i-th row and adding it to j-th row does not change the determinant of the matrix. Again, do the same for the columns.

  • If at least one row of the matrix is zero, the determinant of the matrix will be zero.

  • A regular matrix will always have a determinant different from zero and a singular matrix will always have a determinant equal to zero.

  • The determinant of a matrix in stepwise form is equal to the product of the elements on the main diagonal.

  • If we swap two rows of the matrix, the sign of the determinant changes.

  • |A| = |AT|

  • |A · B| = |A| · |B|

  • |A−1| = 1/|A|

The preceding properties imply a relatively simple procedure to calculate the determinant. Simply arrange the matrix in a stepwise form and then multiply the elements on the main diagonal. Here we go:

$$ A=\begin{pmatrix} 1&3&8\\2&5&0\\-2&2&5 \end{pmatrix} $$

Using standard matrix adjustments, we now adjust the matrix to a stepped shape:

$$ \begin{pmatrix} 1&3&8\\2&5&0\\-2&2&5 \end{pmatrix} \sim \begin{pmatrix} 1&3&8\\0&-1&-16\\0&8&21 \end{pmatrix} \sim \begin{pmatrix} 1&3&8\\0&-1&-16\\0&0&-107 \end{pmatrix} $$

Now we do the product of the elements on the diagonal: 1 · (−1) · (−107) = 107.

Calculate the determinant of this matrix:

$$A=\begin{pmatrix} 3&2&1&5\\2&7&5&6\\6&4&1&0\\4&-3&1&1 \end{pmatrix} $$

The first thing to do is to swap the first and second rows to get the smallest number up. However, we must not forget to change the sign:

$$ \left|\begin{matrix}3&2&1&5\\2&7&5&6\\6&4&1&0\\4&-3&1&1\end{matrix}\right| = -\left|\begin{matrix}2&7&5&6\\3&2&1&5\\6&4&1&0\\4&-3&1&1\end{matrix}\right| $$

Next, it will be quite handy to multiply the second row by two so that we can add nicely. We must not forget to multiply the whole determinant by one half:

$$ -\left|\begin{matrix}2&7&5&6\\3&2&1&5\\6&4&1&0\\4&-3&1&1\end{matrix}\right| = -\frac12 \left|\begin{matrix}2&7&5&6\\6&4&2&10\\6&4&1&0\\4&-3&1&1\end{matrix}\right| $$

And now we proceed classically:

$$\begin{eqnarray} -\frac12 \left|\begin{matrix}2&7&5&6\\6&4&2&10\\6&4&1&0\\4&-3&1&1\end{matrix}\right| &=& -\frac12 \left| \begin{matrix}2&7&5&6\\0&-17&-13&-8\\0&-17&-14&-18\\0&-17&-9&-11\end{matrix}\right| \\ &=& -\frac12 \left| \begin{matrix}2&7&5&6\\0&-17&-13&-8\\0&0&-1&-10\\0&0&4&-3\end{matrix}\right|\\ &=& -\frac12 \left|\begin{matrix}2&7&5&6\\0&-17&-13&-8\\0&0&-1&-10\\0&0&0&-43\end{matrix}\right|\\ &=& -\frac12 \cdot 2 \cdot (-17) \cdot (-1) \cdot (-43) = 731 \end{eqnarray}$$

Laplace development

Laplace was a kind gentleman who devised another algorithm for us to calculate the determinants of a matrix. To understand this cookbook, we will need to know how to compute the special submatrix of the original matrix. We are given the matrix A and we need to create a submatrix that is formed by removing one row and one column from the matrix A. We label this new matrix SAij, which tells us that we have removed i-that row and j-that column from the matrix A. Example:

$$ A=\begin{pmatrix} 1&3&8\\2&5&0\\-2&2&5 \end{pmatrix} $$

The submatrix SA12 would have the following form:

$$ S^A_{12}=\begin{pmatrix} 2&0\\-2&5 \end{pmatrix} $$

Next, we define the term minor, which is nothing more than the determinant of the submatrix SAij we defined. We denote minor in the same way, but with the letter M, i.e. $M^A_{ij}=|S^A_{ij}|$. We can also consider the minor of the element aij, which is just MAij.

Using these minors, we can compute the determinant of the original matrix. In the first step, we choose a row (or column) of the matrix. Then for each element of this row we compute its minor. This gives us as many minors as the row has elements. Now we can express the determinant of the original matrix A of type n × n as a weighted sum of these minors:

$$|A|=\sum_{j=1}^n (-1)^{i+j} \cdot a_{ij} \cdot M^A_{ij}$$

where i is our chosen row. If we iterate over the variable i, we will fix the variable j - the column index.

In practice, it looks like you have a matrix and you want to know the determinant. So you take one column of the matrix (or row) and to each element in that column you determine the minor and assign the sign (−1)i + j and add everything up, multiplying each determinant by the element whose minor the matrix is. Because the minor MAij is still multiplied by the element aij, it is convenient if this element is zero. This eliminates further counting and saves you the work. Let's try to calculate the determinant of this matrix:

$$A=\begin{pmatrix}5&4&8\\6&1&0\\2&3&9\end{pmatrix}$$

There is a single zero in the matrix, so ideally the expansion is done either through the second row or through the third column. For example, choose the row. In the first step, we extract the submatrix:

$$\begin{eqnarray} S^A_{21}&=&\begin{pmatrix}4&8\\3&9\end{pmatrix}\\ S^A_{22}&=&\begin{pmatrix}5&8\\2&9\end{pmatrix}\\ S^A_{23}&=&\begin{pmatrix}5&4\\2&3\end{pmatrix}\\ \end{eqnarray}$$

We now compute the determinants, giving us the minors. For a second order matrix, this is trivial.

$$\begin{eqnarray} M^A_{21}&=&\left|\begin{matrix}4&8\\3&9\end{matrix}\right|=12\\ M^A_{22}&=&\left|\begin{matrix}5&8\\2&9\end{matrix}\right|=29\\ M^A_{23}&=&\left|\begin{matrix}5&4\\2&3\end{matrix}\right|=7\\ \end{eqnarray}$$

Now we can plug this into the formula, i = 2:

$$\begin{eqnarray} |A|&=&(-1)^{2+1} \cdot 6 \cdot \left|\begin{matrix}4&8\\3&9\end{matrix}\right| + (-1)^{2+2}\cdot1\cdot\left|\begin{matrix}5&8\\2&9\end{matrix}\right|+(-1)^{2+3}\cdot\left|\begin{matrix}5&4\\2&3\end{matrix}\right|\cdot0\\ &=&(-1)^{2+1} \cdot 6 \cdot 12 + (-1)^{2+2}\cdot1\cdot29+(-1)^{2+3}\cdot7\cdot0=-43 \end{eqnarray}$$

Note that because the element at the end of the second row is zero, we also get a third addend equal to zero. Another example:

Calculate the determinant of this matrix using Laplace's method:

$$A=\begin{pmatrix}7&2&3&2\\6&6&6&7\\8&10&9&10\\5&7&3&3\end{pmatrix}$$

In the third column we have all multiples of three, we can take advantage of this and zero this column to set the stage for later application of Laplace's method. So to the second row we add −2 the multiple of the first row, to the third row we add −3 the multiple of the first row, and to the fourth −1 the multiple.

$$ \begin{pmatrix}7&2&3&2\\6&6&6&7\\8&10&9&10\\5&7&3&3\end{pmatrix} \sim \begin{pmatrix}7&2&3&2\\-8&2&0&3\\-13&4&0&4\\-2&5&0&1\end{pmatrix} $$

This has not changed the value of the determinant, but it will make it easier to calculate. Let's do the expansion by the third column, where we have only one non-zero element, leaving us with only the minor of the third element of the first row in the expansion:

$$ \left|\begin{matrix}7&2&3&2\\6&6&6&7\\8&10&9&10\\5&7&3&3\end{matrix}\right| (-1)^{1+3}\cdot3\left|\begin{matrix}-8&2&3\\-13&4&4\\-2&5&1\end{matrix}\right| 3\left|\begin{matrix}-8&2&3\\-13&4&4\\-2&5&1\end{matrix}\right| $$

In the third column of the new matrix, we see a one at the very end, which we can easily take advantage of and reset this column to zero:

$$ \begin{pmatrix} -8&2&3\\-13&4&4\\-2&5&1 \end{pmatrix} \sim \begin{pmatrix} -2&-13&0\\-5&-16&0\\-2&5&1 \end{pmatrix} $$

Now we will do the development according to the third column. Again, there is only one non-zero element:

$$ 3\left|\begin{matrix}-2&-13&0\\-5&-16&0\\-2&5&1\end{matrix}\right| 3\cdot\left((-1)^{3+3}\cdot1\cdot\left|\begin{matrix}-2&-13\\-5&-16\end{matrix}\right|\right) 3\cdot\left|\begin{matrix}-2&-13\\-5&-16\end{matrix}\right| $$

And we can calculate this classically: 3 · (32 − 65) = −99.