What is the fastest method for computing determinants?

  • MHB
  • Thread starter Jundoe
  • Start date
  • Tags
    Matrix
In summary: Nop, you expand. Here is a explain Expansion by Minors | Introduction to Linear Algebra | FreeText LibraryAnd here you got an exemple of calculatong determinant of 4x4 matrix...In summary, the second method is more efficient because it avoids dividing a row by an integer.
  • #1
Jundoe
10
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
  • #2
  • #3
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.
 
  • #4
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.
 
  • #5
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,
\(\displaystyle |\pi\rangle\)
 
  • #6
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,
\(\displaystyle |\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.
 
  • #7
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,
\(\displaystyle |\pi\rangle\)
 
  • #8
Re: upper triangular matrix

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

Regards,
\(\displaystyle |\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.
 
  • #9
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,
\(\displaystyle |\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,
\(\displaystyle |\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.)
 

1. What is an upper triangular matrix?

An upper triangular matrix is a square matrix in which all the elements below the main diagonal are zero. It gets its name because the non-zero elements are only present in the upper triangular part of the matrix.

2. How is an upper triangular matrix different from a lower triangular matrix?

An upper triangular matrix has non-zero elements only in the upper triangular part, while a lower triangular matrix has non-zero elements only in the lower triangular part. Both types of matrices have zero elements in the opposite triangular part.

3. What are the benefits of using an upper triangular matrix?

Upper triangular matrices are useful in solving systems of linear equations, as they can be easily manipulated using Gaussian elimination. They also have reduced storage requirements compared to a full matrix, making them more efficient to store and compute with.

4. Can an upper triangular matrix be inverted?

Yes, an upper triangular matrix can be inverted as long as all its diagonal elements are non-zero. The inverse of an upper triangular matrix is also an upper triangular matrix.

5. How are upper triangular matrices used in computer graphics?

In computer graphics, upper triangular matrices are used for 3D transformations, such as rotation, translation, and scaling. This is because these transformations can be represented as matrix multiplication, and upper triangular matrices are efficient to compute with.

Similar threads

  • Linear and Abstract Algebra
Replies
10
Views
149
  • Linear and Abstract Algebra
Replies
8
Views
802
  • Linear and Abstract Algebra
Replies
11
Views
4K
Replies
24
Views
1K
  • Linear and Abstract Algebra
Replies
5
Views
1K
  • Linear and Abstract Algebra
Replies
4
Views
1K
  • Linear and Abstract Algebra
Replies
12
Views
2K
  • Linear and Abstract Algebra
Replies
6
Views
1K
  • Linear and Abstract Algebra
Replies
5
Views
968
  • Linear and Abstract Algebra
Replies
1
Views
1K
Back
Top