What is the fastest method for computing determinants?

  • Context: MHB 
  • Thread starter Thread starter Jundoe
  • Start date Start date
  • Tags Tags
    Matrix
Click For Summary
SUMMARY

The fastest method for computing determinants is Gaussian row-reduction to an upper-triangular matrix. When performing row operations, dividing a row by a constant affects the determinant by dividing it by that same constant. The discussion highlights the importance of understanding these operations, especially when applying Cramer's rule for larger matrices. Additionally, the Rule of Sarrus is recommended for quickly calculating determinants of 3x3 matrices, particularly when zeros are present in the matrix.

PREREQUISITES
  • Understanding of Gaussian elimination and row operations
  • Familiarity with determinants and their properties
  • Knowledge of Cramer's rule for solving systems of equations
  • Basic linear algebra concepts, including matrix manipulation
NEXT STEPS
  • Study Gaussian elimination techniques for larger matrices
  • Learn about the Bareiss algorithm for efficient determinant computation
  • Practice using the Rule of Sarrus for 3x3 matrices
  • Explore the concept of expansion by minors for 4x4 matrices
USEFUL FOR

Students preparing for exams in linear algebra, mathematicians, and anyone involved in computational mathematics or algorithm development.

Jundoe
Messages
10
Reaction score
0
I want to make an upper triangular matrix. From this:
$\begin{bmatrix}2&0&1\\0&1&1\\3&1&0 \end{bmatrix}$

The first is the correct one. The second is incorrect, yet I fail to understand why.

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

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

$\begin{bmatrix}2&0&1\\0&1&1\\0&0&-5/2 \end{bmatrix}$
Second method.

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

$\begin{bmatrix}1&0&1/2\\0&1&1\\3&1&0 \end{bmatrix}$ As you can see, I've immediately divided the first row by 2 so that I can get a pivot of 1.

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

$\begin{bmatrix}1&0&1/2\\0&1&1\\0&0&-5/2 \end{bmatrix}$What happened? Is dividing a row by an integer illegal?

[edit.] The reason for the upper triangular matrix, is because I want to find the determinant.
I am aware that switching rows causes the sign to change. No big issue, because I can note this, and at the end adjust the determinant accordingly. But is this similar? Is the returned determinant supposed to be re-multiplied because I had divided it first?
 
Last edited:
Physics news on Phys.org
Re: upper triangular matrix

When you multiply a row (or a column) by a constant, you multiply the determinant by that constant. So when you divided the top row by 2, you were also dividing the determinant by 2.
 
Re: upper triangular matrix

The algorithm to calculate a determinant is slightly different from the algorithm to solve a system of equations.
The principle is the same though.
If you divide a row by a number, you also have to divide the result by that number.
 
Re: upper triangular matrix

Jundoe said:
I want to make an upper triangular matrix. From this:
$\begin{bmatrix}2&0&1\\0&1&1\\3&1&0 \end{bmatrix}$

The first is the correct one. The second is incorrect, yet I fail to understand why.

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

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

$\begin{bmatrix}2&0&1\\0&1&1\\0&0&-5/2 \end{bmatrix}$
Second method.

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

$\begin{bmatrix}1&0&1/2\\0&1&1\\3&1&0 \end{bmatrix}$ As you can see, I've immediately divided the first row by 2 so that I can get a pivot of 1.

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

$\begin{bmatrix}1&0&1/2\\0&1&1\\0&0&-5/2 \end{bmatrix}$What happened? Is dividing a row by an integer illegal?

[edit.] The reason for the upper triangular matrix, is because I want to find the determinant.
I am aware that switching rows causes the sign to change. No big issue, because I can note this, and at the end adjust the determinant accordingly. But is this similar? Is the returned determinant supposed to be re-multiplied because I had divided it first?
Hello,
You could Also use rule of sarrus (would take you only 10-15 sec calculate it out)! You got many zero in the matrix so it would be easy to think out the answer!
Or maybe you wanted to practice with reducing the matrix.
Regards,
$$|\pi\rangle$$
 
Re: upper triangular matrix

Petrus said:
Hello,
You could Also use rule of sarrus (would take you only 10-15 sec calculate it out)! You got many zero in the matrix so it would be easy to think out the answer!
Or maybe you wanted to practice with reducing the matrix.
Regards,
$$|\pi\rangle$$

Actually this was an example. I was trying to understand this for a larger matrix seeing as my final will request I find the determinant of a 4x4. *I must've missed that vital information from my textbook–again, thanks EVERYONE for your inputs.

That said, when it comes to finding the determinant for a Cramer's rule application, our finals usually don't go over 3x3, so the rule of Sarrus is awesome for that.
 
Re: upper triangular matrix

Jundoe said:
Actually this was an example. I was trying to understand this for a larger matrix seeing as my final will request I find the determinant of a 4x4. *I must've missed that vital information from my textbook–again, thanks EVERYONE for your inputs.

That said, when it comes to finding the determinant for a Cramer's rule application, our finals usually don't go over 3x3, so the rule of Sarrus is awesome for that.
You can ALWAYS make a 4x4 matrix to 3x3 matrix.

Regards,
$$|\pi\rangle$$
 
Re: upper triangular matrix

Petrus said:
You can ALWAYS make a 4x4 matrix to 3x3 matrix.

Regards,
$$|\pi\rangle$$

This is intriguing. How would I proceed?
Would I have to multiply the [4x4]matrix by some [4x3]matrix, then take the new [4x3] result and have it multiplied like so: [3x4][4x3], thus yielding a [3x3]?

...a google search only offered programmer contents.
 
Re: upper triangular matrix

Jundoe said:
This is intriguing. How would I proceed?
Would I have to multiply the [4x4]matrix by some [4x3]matrix, then take the new [4x3] result and have it multiplied like so: [3x4][4x3], thus yielding a [3x3]?

...a google search only offered programmer contents.
Nop, you expand. Here is a explain Expansion by Minors | Introduction to Linear Algebra | FreeText Library
And here you got an exemple of calculatong determinant of 4x4 matrix http://nebula.deanza.edu/~bloom/math43/Determinant4x4Matrix.pdf
Regards,
$$|\pi\rangle$$
 
  • #10
Re: upper triangular matrix

Petrus said:
Nop, you expand. Here is a explain Expansion by Minors | Introduction to Linear Algebra | FreeText Library
And here you got an exemple of calculatong determinant of 4x4 matrix http://nebula.deanza.edu/~bloom/math43/Determinant4x4Matrix.pdf
Regards,
$$|\pi\rangle$$

Just tried it out. This is much better than doing it by reaching an upper triangle. I don't know which is faster, but for my final I'm definitely going with this method. It's less error-prone. :D

Thanks!
 
  • #11
Re: upper triangular matrix

Jundoe said:
Just tried it out. This is much better than doing it by reaching an upper triangle. I don't know which is faster, but for my final I'm definitely going with this method. It's less error-prone. :D

Thanks!

So far as I know, the fastest exact method for computing determinants is basically Gaussian row-reduction to an upper-triangular matrix. (They have fancy variants of it like the Bareiss algorithm.)
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 33 ·
2
Replies
33
Views
2K
  • · Replies 11 ·
Replies
11
Views
6K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 24 ·
Replies
24
Views
2K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 12 ·
Replies
12
Views
2K