# Creating a lower-triangular matrix when $A[n,n] =0$?

As far as I learned in my limited experience in linear algebra, to convert a matrix to upper triangular form through Gaussian Elimination, you would add/subtract multiples of the first row so that $A[2,1]$ would be $0$, and so on.

I was going to do the same basic idea to convert a matrix to lower-triangular, but the $4\times 4$ matrix I need to do this for has $A[4,4]=0$. $$A = \begin{bmatrix}3 & 4 & 1 & 2 \\ -1 & 2 & 0 & -2 \\ 1 & 1 & 2 & -1 \\ 2 & -3 & 1 & 0\end{bmatrix}$$

How would I do GE to make this matrix lower-triangular, then?

• This is a problem I am supposed to code. I just don't understand how it's supposed to work mathematically. Which I obviously need to understand first. My professor insists that this is possible, so I must have a hole in my math knowledge. – q-compute Mar 29 '17 at 6:59

This is a version of Gaussian elimination. Gaussian elimination usually refers to the procedure of creating an upper triangular matrix, but I think you can figure out how to modify to get a lower-triangular matrix.

OK, so the problem is when $A[n,n]=0$. But then I think you missed this part of the algorithm:

i_max  := argmax (i = 1 ... k , abs(A[i, k]))
if A[i_max, k] = 0
k = k - 1
continue
swap rows(k, i_max)


Basically, when you encounter a $0$ entry, you try to search in the same column for a non-zero entry. Then you would swap the two rows. For example, in this case, we would swap the first row and the last row to get

$$\left[\begin{array}{rrrr} 2 & -3 & 1 & 0\\ -1 & 2 & 0 & -2\\ 1 & 1 & 2 & -1\\ 3 & 4 & 1 & 2 \end{array}\right]$$

and continue with eliminating the rest of the column.

• I don't think I can if that's exactly the question I'm asking??? – q-compute Mar 29 '17 at 7:03
• Please read the Wiki link. There is a pseudo-code for the algorithm. Try to play with it. – Quang Hoang Mar 29 '17 at 7:05
• I've already written code almost exactly like that code to create an upper triangular matrix. I've noodled around with it and I can't get it to create a lower-triangular matrix, which is why I was asking, mathematically, how it is supposed to work. Because I don't understand it mathematically. – q-compute Mar 29 '17 at 7:09
• See the update if you can understand it? – Quang Hoang Mar 29 '17 at 7:21
• Oh! That makes sense. And now that seems silly. I haven't taken LA nor really used it in a year so I forgot such a simple thing. Thanks! – q-compute Mar 29 '17 at 7:23