3
$\begingroup$

How can we mathematically and algorithmic-ally convert a $n\times n$ matrix to a upper triangular matrix

  • 5
    You'll have to give more information about what sort of "conversion" you want. It's possible to just change everything below the diagonal to zero, but that's probably not what you're looking for.2012-11-08
  • 0
    By "convert", I take it you mean "find an upper triangular matrix *similar* to a given matrix"?2012-11-08
  • 1
    Or perhaps you mean Gaussian - Elimination?2012-11-08
  • 1
    ...because, as mentioned, your question is exceedingly vague as it stands. Gaussian elimination will decompose your matrix as the product of an upper and lower triangular matrix, while Jordan decomposition will yield a (special) triangular matrix whose eigenvalues are the same as the eigenvalues of your original matrix. Can you be clearer?2012-11-08
  • 0
    @EuYu Yeah i mean Gaussian Elimination2012-11-08
  • 0
    @J.M. I'm not a mathematician. Just a kid that passed high school just now, and i want that for a algorithm that helps me in my programming. So, I do not know things like eigenvalues or so. Please Provide me a simple answer to the question2012-11-08
  • 0
    \*sigh\* If you had mentioned what you'd be using the "conversion" for (in other words, your **actual problem**), you could have saved all of us the trouble. So, since you say Gaussian elimination suits your needs, you just want to solve a set of linear equations?2012-11-08
  • 0
    actually, what i need to do is: find a determinant of n by n matrix using a computer program. So, I googled the numerical methods and found that if i convert the matrix into upper-triangular and multiply the diagonals , i get the determinant and that thing was referring to Gaussian Elimination. Hope you get me @J.M.2012-11-08
  • 0
    You need $PLU$-decomposition in that case and not simply Gaussian elimination.2012-11-08
  • 0
    See, when asking a question here, details like those are *very important*, and thus, you should edit your question to mention that detail. "I want to compute the determinant of a matrix, and...". BTW: "convert" is not the right term to use. Again: Gaussian elimination *factorizes/decomposes* your matrix into a lower triangular and upper triangular matrix.2012-11-08
  • 0
    @cipher Perhaps I should further ask why you need the determinant. Are you sure it is necessary for whatever you need?2012-11-08
  • 1
    @EuYu, actually, LU decomposition and Gaussian elimination (and for that matter, row reduction) are equivalent... LU is just a "decompositional" way to look at the process of Gaussian elimination, nothing more or fancier.2012-11-08
  • 0
    @J.M. Yea, I realize that. I was thinking of just returning the REF of the matrix without keeping track of the elementary row operations.2012-11-08
  • 0
    @EuYu, sure, if you're interested in only the determinant, you don't really need to keep $\mathbf L$ around... :)2012-11-08

1 Answers 1

3

It appears from the comments that what OP wants to do is to calculate the determinant of a square matrix by using elementary row operations to bring the matrix to upper triangular form, then multiplying all the diagonal entries.

One needs to know that if you get from matrix $A$ to matrix $B$ by

(1) subtracting any multiple of any row of $A$ from any other row of $A$ then $\det B=\det A$;

(2) by exchanging two rows of $A$ then $\det B=-\det A$.

Now, look for a nonzero entry in the first column of your matrix. If there aren't any, stop: the determinant is zero.

If you do locate a nonzero entry in the first column, swap the row containing that entry with the first row [see (2), above], if necessary, then subtract multiples of the first row from each other row in turn [see (1), above] in such a way as to bring all the other entries in the first column to zero.

Now forget about the first row and column of the matrix, and apply the procedure to the rest of the matrix. Keep doing this until an all-zero column halts the computation or until you run out of matrix. If you run out of matrix, you have created an upper triangular matrix, and you know what to do.

This works better in theory than in practice. In theory, it doesn't matter which choices you make along the way; in practice, it can make a great deal of difference. But, then, if you're really looking for a practical way to calculate a determinant, you just use a program someone else has already written that does it for you.