# Computing the $4 \times 4$ determinant of a matrix

Compute the determinant of

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

by first expanding along the first row (at every stage) and then by expanding along whatever row or column requires the fewest computations

I'm trying to put this matrix in Lower Triangular Form (LTF) so that I can find the determinant by just taking the product of the diagonal. I'm stuck though, I'm not sure where I went wrong.

I did:

$$R_3 = 2R_1 + (-1)R_3$$

$$R_4 = 2R_1 + (-1)R_4$$

$$R_4 = 7R_1 + (-1)5R_4$$

to get:

$$\begin{bmatrix}1&-2&5&2\\0&0&3&0\\0&0&13&-1\\7&6&0&19\end{bmatrix}$$

• That's not what "expanding" the determinant means. – got it--thanks Jul 12 '16 at 22:02
• @gotit--thanks No idea what "expanding" the determinant means so I am trying the alternative, putting it in LTF and taking the product of the diagonal. – Yusha Jul 12 '16 at 22:03
• look up cofactor expansion, the determinant should be a number not another matrix – Alex Jul 12 '16 at 22:06
• By using LTF and taking the product of the diagonal you get the determinant of the matrix, not another matrix so not quite sure what you're alluding to @Alex – Yusha Jul 12 '16 at 22:08
• @Yusha Watch these Khan Academy videos to see how to do the problem the way the exercise asks. You can start with the video on the $3\times 3$ determinant. – got it--thanks Jul 12 '16 at 22:10

\begin{eqnarray} \left|\begin{matrix}1&-2&5&2\\0&0&3&0\\2&-4&-3&5\\2&0&3&5\end{matrix}\right|&=& -3\left|\begin{matrix}1&-2&2\\2&-4&5\\2&0&5\end{matrix}\right|\\ &=& -3 \left|\begin{matrix}1&0&2\\2&0&5\\2&4&5\end{matrix}\right|\\ &=& -3\times(-4) \left|\begin{matrix}1&2\\2&5\end{matrix}\right|\\ &=& 12\times (5-4)\\ &=&12 \end{eqnarray} where in the first step i expand the determinant from the second line (because they have 3 zero in this line) and i remove the second line and the third column.

for the second step i "create" more zero by adding to the second column two times the first column and i expand with this column to get the last $2\times 2$ determinant which calculation is very easy

• In step 3 I think there is a mistake. You've swapped $R_2$ with $R_3$ and changed the signs – Yusha Jul 12 '16 at 22:20
• no the calculation is right, i have just developing % the second column – Hamza Jul 12 '16 at 22:37

What they want is an "expansion by minors" which is given by the formula $$|A|=\sum_i^j(-1)^{i+j}a_{ij}M_{ij}$$ Which is more intimidating looking than the process actually is. You pick a row or column and go across the row or column and for each element $a_{ij}$, "delete" the i'th row and j'th column in your mind, finding the determinant of the submatrix $M_{ij}$.

Keeping track of the sign of each term of your sum determined by the parity of $i+j$, you sum each mini determinant to get the big determinant.

In your case you will have to do expand again within your expansion to get down to a 2 by 2 block, where you can use the formula $ad-bc$.

If you want to do it your way, I suppose you could row reduce to a upper triangular matrix, keeping track of your operations; row swapping changes the sign of the determinant, multiplication of a row by a constant multiplies your matrix by a constant (the determinant is linear in columns and rows). That being said, you should learn cofactor expansion, it's important.

• Cofactor expansions are theoretically extremely important (e.g., proving that $GL(n,\mathbb{Z})$ is a group), but from a numerical standpoint, the OP's instinct towards Gaussian elimination is absolutely correct—for anything larger than a $3 \times 3$, Gaussian elimination starts rapidly becoming many orders of magnitude more efficient than cofactor expansion (unless, of course, you have an example like this one, tailor-made for a clever cofactor expansion). – Branimir Ćaćić Jul 12 '16 at 22:23
• @BranimirĆaćić I was mostly going off the directions in the problem and the row of zeros, – qbert Jul 12 '16 at 22:25
• @BranimirĆaćić OP didn't have an instinct towards GE -- (s)he states clearly in the comments that (s)he doesn't even know about cofactor expansions. So now's the time for him/her to learn. – got it--thanks Jul 12 '16 at 22:27
• Fair enough. I also now see that they haven't even got GE quite down (and not just that they prematurely abandoned their attempt). – Branimir Ćaćić Jul 12 '16 at 22:44

"expanding the determinant" means doing $$||M|| = 1\cdot \left|\left| \matrix{0&3&0\\-4&-3&5\\0&3&5}\right|\right|-(-2)\cdot \left|\left| \matrix{0&3&0\\2&-3&5\\2&3&5}\right|\right|+ 5\cdot \left|\left| \matrix{0&0&0\\2&-4&5\\2&0&5}\right|\right|-2\cdot \left|\left| \matrix{0&0&3\\2&-4&-3\\2&0&3}\right|\right|$$