# How to efficiently compute the determinant of a matrix using elementary operations?

Need help to compute $\det A$ where $$A=\left(\begin{matrix}36&60&72&37\\43&71&78&34\\44&69&73&32\\30&50&65&38\end{matrix} \right)$$

How would one use elementary operations to calculate the determinant easily?

I know that $\det A=1$

-
+1 $~~~~~~~~~~~~~$ –  Babak S. Feb 1 '13 at 14:51
If you care about the number of operations, here's a trick with 30 multiplications: bitbucket.org/eigen/eigen/src/… –  user161143 Jul 1 '14 at 20:49

## 3 Answers

I suggest Gaussian Elimination till upper triangle form or further but keep track of the effect of each elementary. see here for elementary's effect on det

-
or use softwares such as matlab or free sources like wolframalpha if dimension is too high –  mez Jan 24 '13 at 19:41
Trying to do something like this by hand is a real waste of time. Any computer algebra system will give you the answer instantly. –  Robert Israel Jan 24 '13 at 19:44
@RobertIsrael It might not be a waste of time if you are in exam.:) –  mez Jan 24 '13 at 19:45
Nobody in their right mind would ask for a $4 \times 4$ determinant with all distinct $2$-digit entries on an exam. –  Robert Israel Jan 24 '13 at 19:55
@RobertIsrael You cannot nullify this person's curiosity for a method that is of use by saying it is a waste of time. 4*4 determinants have appeared on my exam though not all 2-digit, but complicated enough. You are assuming too much, who are you to judge what is a waste of time for him anyway? –  mez Jan 24 '13 at 19:59

Here's one way to do it without fractions. You could start by subtracting row $2$ from row $3$ to get $$\left[ \begin {array}{cccc} 36&60&72&37\\ 43&71&78&34\\ 1&-2&-5&-2\\ 30&50&65&38 \end {array} \right]$$ Then subtract $36$, $43$, and $30$ times row $3$ from rows $1$, $2$ and $4$ respectively to get $$\left[ \begin {array}{cccc} 0&132&252&109\\ 0&157&293&120\\ 1&-2&-5&-2\\ 0&110&215& 98\end {array} \right]$$ Expanding by minors in the first column, we just need one $3 \times 3$ determinant, which is $$132 \times 293 \times 98 + 252 \times 120 \times 110 + 109 \times 157 \times 215 - 132 \times 120 \times 215 - 252 \times 157 \times 98 - 109 \times 293 \times 110 = 1$$ I hope you're allowed to use a calculator for that...

-

For a 4x4 determinant I would probably use the method of minors: the 3x3 subdeterminants have a convenient(ish) mnemonic as a sum of products of diagonals and broken diagonals, with all the diagonals in one direction positive and all the diagonals in the other direction negative; this lets you compute the determinant of e.g. the bottom-right 3x3 as 71*73*38 + 78*32*50 + 34*69*65 - 34*73*50 - 71*32*65 - 78*69*38. That's probably slightly less than a 5-minute calculation with pencil and paper and a 1-minute calculation with a calculator, which means you could find the overall determinant in maybe 5 minutes with calculator, 15-20 with pencil and paper. Not blazingly fast, of course, but for me I suspect it'd be marginally faster than Gaussian Elimination, and the all-integer nature of it is (for me, at least) a minor plus. Alternately, the subdeterminants can be computed by taking minors again; this cuts down slightly on the number of multiplications per subdeterminant(from 12 to 9) and gives a total of 40 multiplications to compute the 4x4 determinant.

-
just out of curiosity, what you mentioned is what I thought to be the standard way, do you know any other way? –  mez Jan 24 '13 at 20:16
@mezhang Well, there's the direct approach in terms of summing over all the permutations, but you're right that this is more or less the canonical brute-force method. I'll add another method that actually works pretty well here... –  Steven Stadnicki Jan 24 '13 at 20:28
Could you explain or show me a link to the summing over all permutations method? I don't know it. –  mez Jan 24 '13 at 20:33
@mezhang It's one of the definitions of the determinant; see en.wikipedia.org/wiki/Leibniz_formula_for_determinants , for instance. –  Steven Stadnicki Jan 24 '13 at 21:03