Operation Count for LU Decomposition

In summary: So that's where the 4 operations come from.In summary, the LU decomposition of the given n x n matrix A = diag[1,3,1] only requires 4 operations to be performed, as the matrix is already in upper diagonal form. This can be added to the general operation count formula of mn^2, resulting in a total operation count of n^2 + 4. However, there may be a more efficient method for determining the LU decomposition of this particular matrix, depending on its specific structure.
  • #1
twoski
181
2

Homework Statement



Consider the n x n matrix A = diag[1,3,1]

and vector x: (1,2,3)

Determine the number of operations needed to compute the LU decomposition of this n x n matrix.

The Attempt at a Solution



So for a general n x n matrix, my prof's notes say that LU decomposition takes [itex]n^{3}/3 - n/3 + mn^{2}[/itex] operations for m right hand sides.

however this question is different since there are zeroes in the matrix. Specifically, there are only n-1 values on the left hand side of the diagonal that i need to deal with. So this means the total number of multiplications for getting the U matrix is 2(n-1) (because each multiplication affects the diagonal as well).

Does the nature of this matrix affect the operation count for the Lg=f and Ux=g calculations?
 
Physics news on Phys.org
  • #2
twoski said:

Homework Statement



Consider the n x n matrix A = diag[1,3,1]

and vector x: (1,2,3)

Determine the number of operations needed to compute the LU decomposition of this n x n matrix.

The Attempt at a Solution



So for a general n x n matrix, my prof's notes say that LU decomposition takes [itex]n^{3}/3 - n/3 + mn^{2}[/itex] operations for m right hand sides.

however this question is different since there are zeroes in the matrix. Specifically, there are only n-1 values on the left hand side of the diagonal that i need to deal with. So this means the total number of multiplications for getting the U matrix is 2(n-1) (because each multiplication affects the diagonal as well).

Does the nature of this matrix affect the operation count for the Lg=f and Ux=g calculations?

Never mind using formulas that you may not really understand; just DO IT!. That is: compute the LU decomposition of your matrix A = diag[1,3,1]. How many computations did you perform?
 
  • #3
The problem is, this is going to be one of many problems on an upcoming test, and there seems to be a general method for determining how many operations are needed... Given that there is a strict time limit, it might not be wise to manually tally up the operation counts...

Here is the portion of my prof's notes which details how operation counts are done... I suppose it might be easy to just alter the diagrams based on the zero structure of the matrix?

bTbXtSQ.png


I find it hard to decipher what is actually going on in the diagram though. And the conversion from summation form is equally confusing.
 
  • #4
twoski said:
The problem is, this is going to be one of many problems on an upcoming test, and there seems to be a general method for determining how many operations are needed... Given that there is a strict time limit, it might not be wise to manually tally up the operation counts...

Here is the portion of my prof's notes which details how operation counts are done... I suppose it might be easy to just alter the diagrams based on the zero structure of the matrix?

bTbXtSQ.png


I find it hard to decipher what is actually going on in the diagram though. And the conversion from summation form is equally confusing.

OK, but that is (probably) NOT what the question asked: it said " ... LU decomposition of this n x n matrix", so it (presumably) had that particular matrix in mind, not just any general matrix. At least, that would be my interpretation when including the word "this".

I guess there could be a subtler issue at work here: if you can say "Aha... that matrix is very special" you can do much better than using the general LU Decomposition algorithm. However, a computer (not necessarily a human) would need to do a lot of preliminary work to "recognize" whether or not a matrix is special: it would need at least to examine each element of the matrix one-by-one, and probably do a lot more as well. A human, on the other hand, can just look at the matrix and make an instant conclusion. I must leave it up to you to decide on the "correct" interpretation, but maybe the best answer is to present two possible scenarios and to do the analysis for each.
 
  • #5
For this question i believe that i have to determine the operation count for this specific matrix...

So there would only be 4 total operations to calculate the U matrix, and then i'd just add that to mn^2 i guess? I don't see where m actually comes into this since there's only one right hand side, so i suppose i could just say n^2 +4 is the answer?
 
  • #6
twoski said:
For this question i believe that i have to determine the operation count for this specific matrix...

So there would only be 4 total operations to calculate the U matrix, and then i'd just add that to mn^2 i guess? I don't see where m actually comes into this since there's only one right hand side, so i suppose i could just say n^2 +4 is the answer?

Have you not noticed that your matrix is already a "U", so you don't need an "L"? That is, you don't need to do any work at all to put it into LU form; all you need to do is perform 3 divisions of the form ##x_i = b_i/a_{ii}##, where ##b## is the given right-hand-side vector (which you called x, but I don't believe that is what was meant).
 
  • #7
Apologies, i forgot to mention that my professor may have a different definition for what diag[1,3,1] means. In his example, the matrix for diag[1,3,1] looks like:

3 1 0
1 3 1
0 1 3

So in order to make this upper diagonal, we need to eliminate both bottom 1's, which means a total of 4 multiplications will occur before they are eliminated.
 

Related to Operation Count for LU Decomposition

1. What is LU decomposition?

LU decomposition, also known as LU factorization, is a method of decomposing a square matrix into a lower triangular matrix (L) and an upper triangular matrix (U).

2. What is the purpose of using LU decomposition in operations?

LU decomposition is commonly used in numerical analysis and linear algebra to solve systems of linear equations efficiently. It can also be used for matrix inversion and calculating determinants.

3. How is LU decomposition different from other matrix decomposition methods?

LU decomposition is similar to other matrix decomposition methods, such as Cholesky decomposition and QR decomposition, in that it breaks down a matrix into simpler forms. However, LU decomposition is unique in that it specifically decomposes a matrix into a lower triangular matrix and an upper triangular matrix.

4. What are the advantages of using LU decomposition?

LU decomposition can improve the efficiency of solving systems of linear equations, as it reduces the amount of calculations needed. It also allows for faster matrix inversion and determinant calculations. Additionally, LU decomposition can be used in other operations, such as finding eigenvalues and eigenvectors.

5. Are there any limitations or drawbacks to using LU decomposition?

One limitation of LU decomposition is that it can only be applied to square matrices. Additionally, it may not always be possible to perform LU decomposition, as some matrices are not suitable for this method. In such cases, other matrix decomposition methods may need to be used.

Similar threads

  • Calculus and Beyond Homework Help
Replies
5
Views
2K
  • Calculus and Beyond Homework Help
Replies
6
Views
1K
Replies
22
Views
3K
  • Calculus and Beyond Homework Help
Replies
3
Views
552
  • Calculus and Beyond Homework Help
Replies
8
Views
1K
  • General Math
Replies
2
Views
946
  • Linear and Abstract Algebra
Replies
2
Views
551
  • Linear and Abstract Algebra
Replies
8
Views
958
  • Calculus and Beyond Homework Help
Replies
5
Views
2K
  • Calculus and Beyond Homework Help
Replies
3
Views
837
Back
Top