[Math] Determinant of Triangular Matrix

linear algebramatrices

I understand that you can find the determinant of a matrix along it's diagonal if it is in triangular form. For a matrix such as this:
$$
\begin{pmatrix}
1 & 5 & 0\\
2 & 4 & -1\\
0 &-2 & 0
\end{pmatrix}
$$
When put into triangular form I get:
$$
\begin{pmatrix}
1 & 5 & 0\\
0 & 1 & 1/6\\
0 & 0 & 1/3
\end{pmatrix}
$$
Since I multiplied row two by -1/6 during the row reduction I would expect the determinant to be
$$
1\cdot 1\cdot 1/3\cdot (-1/6),$$
but the answer for the determinant of the original matrix is -2. Where exactly am I going wrong?

Best Answer

You can add a multiple of any row to another row without changing the determinant. So I'll do these kinds of operations to get to the triangular form.

Start with

$$\begin{matrix} 1 & 5 & 0 \\ 2 & 4 & -1 \\ 0 &-2 &0 \end{matrix}$$

Subtract twice the first row from the second:

$$\begin{matrix} 1 & 5 & 0 \\ 0 & -6 & -1 \\ 0 &-2 &0 \end{matrix}$$

Subtract one-third the new second row from the third:

$$\begin{matrix} 1 & 5 & 0 \\ 0 & -6 & -1 \\ 0 & 0 & \frac{1}{3} \end{matrix}$$

The product along the diagonal is $-2$.

Pulling out a factor from one of the rows, however, does change the determinant by that factor. You pulled out $-1/6$ from the second row, so the calculated determinant from the diagonal in your question statement was low by this factor.