Course Webpage

Matrix determinant

Compute the determinant of

$$ A=\left(\begin{array}{crc} 1 & 1 & 3\\ 3 & 0 & 1\\ 1 & -2 & 1 \end{array}\right) \quad A_1=\left(\begin{array}{crc} 0 & 1 & 3\\ 3 & 0 & 1\\ 1 & -2 & 1 \end{array}\right) $$

Taking into account the following properties of the determinants:

  1. If we swap two rows in a matrix, the determinant is multiplied by $-1$.
  2. If we divide a row by a nonzero constant the determinant of the matrix is divided by that value.
  3. If we multiply a row by a non-zero real and add it to another the value of the determinant does not change.
  4. The value of the determinant of a triangular or diagonal matrix is the product of the elements of the diagonal.

Gauss elimination

In this case, starting with $A$, we arrive at

$$ \left(\begin{array}{rrr} 1 & 1 & 3 \\ 0 & -3 & -8\\ 0 & 0 & 6 \end{array}\right) $$

using rows added to others (property 3) so we only have to multiply the elements of the diagonal (property 4) and $$\left|A\right|=(1)\times (-3)\times (6) = -18.$$

Gauss elimination with pivoting

In this case, starting with $A$, we arrive at

$$ \left(\begin{array}{rrrr} 3 & 0 & 1 \\ 0 & -2 & \frac{2}{3}\\ 0 & 0 & 3 \end{array}\right) $$

Now, in addition to row operations, we have swapped rows twice. Every time we exchange rows, the determinant of the matrix is multiplied by $-1$ (property 1). Therefore we will have to add to the product of the elements of the diagonal $(-1)\times (-1)$ y $$\left|A\right|=(-1)\times (-1)\times(3)\times (-2)\times (3) = -18.$$

Gauss-Jordan method

The final matrix is the identity matrix and we have performed row operations and divided the rows by the pivot. Therefore we have to multiply the factors by which we have divided each row (property 2) and

$$\left|A\right|=(1)\times (-3)\times(6)= -18.$$

LU decomposition

As the $U$ matrix is the same as the one obtained by Gauss (with or without pivoting respectively), the determinant would be obtained from this matrix as in Gaussian elimination.

Starting from the matrix $A_1$ we arrive at the matrix $U$

$$ \left(\begin{array}{rrr} 3 & 0 & 1\\ 0& -2 & 2/3\\ 0& 0& 10/3 \end{array}\right) $$

And since we have swapped rows twice, the determinant is

$$\left|A_1\right|=(-1)\times (-1)\times(3)\times (-2)\times (10/3) = -20.$$

Gauss elimination and $LU$ factorization are, if we only perform the first step, the same.

In the case of Gauss-Jordan, Gauss is a cheaper method if we only want to calculate the determinant.

The most suitable method to calculate the determinant would be Gauss with partial pivoting, because there are matrices with nonzero determinants where Gauss elimination can get stuck because a zero appears at the pivot position. This would not be an inconvenience in Gauss with partial pivoting, because we would swap the row for another where the pivot is not zero. And if this is not possible, it means that the determinant of the matrix is zero and the problem is solved.