# Strategies for creating triangular matrices?

I'm taking a linear algebra matrices course, and the one basic tool I cannot seem to grasp is the formation of upper and lower triangular matrices.

Observing the elementary row operations: where $A$ is some $n\times n$ matrix.

1. Interchange two rows.
2. Multiply rows $i$ by $c$ where $c \ne 0$.
3. Add c times row $i$ to another row.

Recognizing that the same properties hold true for column manipulation.

What is an efficient method to form a triangular matrix and avoid messy fractions if possible? What sort of patterns should I look for in solving to save time?

I recognize that if there is some matrix where elements are multiples, manipulation is easy. However, one sample problem in the prescribed book is not such the case: $$\begin{bmatrix} -2&0&1&3 \\ 4&0&2&-2 \\ -3&1&0&1 \\ 5&4&1&7\\ \end{bmatrix}$$

If you want to avoid fractions, use rows that have $1$ in that column. For example, for the second column, I would eliminate using the third row since the third row's second component is $1$.

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

Now, in order to put that $1$ in the second on the diagonal, change the third row into the second row by switching the two:

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

Now, there is also a $1$ in the fourth component of the second row, but since we have already used that and set it as the second row, we can't really eliminate with that row again. If we did, we'd have to put that row as both the second and fourth row so that both of its $1$s could be on the diagonal, which is impossible.

Instead, we'll notice that the first row has a $1$ in its third component, so we can eliminate the third column using that:

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

Now, we switch the first and third rows so we can get that $1$ on the diagonal:

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

At this point, all we need to eliminate is the first column, which can be done with the first row since it has $0$s in the middle components and its first component doesn't need to be eliminated, so it won't mess up any of the other upper triangular-ness while eliminating the first column. I won't get into that since that will be the messy part with lots of fractions, but hopefully now, you know how to offset the messy fraction part for as long as possible by eliminating with $1$s.

(Also, I think I was pretty lucky in this example since I got to eliminate with $1$s twice, which doesn't usually happen in the examples I've done.)

• So as a general rule of thumb, is it best to work by row or by column, and from left to right? For instance, if I were aiming for an upper triangular, would it be best to work for a zero in $A_{12}$ and then work my way to the right? – Matt Oct 28 '16 at 1:47
• There's no real direction or algorithm in what I am trying to do in the above method other than trying to eliminate columns in order to have as many 0s and 1s as possible to avoid fractions. As for the example you suggested, making zeroes in the first row for all entries except $A_{11}$ would help you in making a lower triangular, but does not help make any zeroes for the upper triangular, where zeroes in the lower-right are needed. – Noble Mushtak Oct 29 '16 at 19:20
• The prescribed linear algebra book for my specific course is awful and has little explanation. While your response does not exactly answer my question, your method of first aiming to align 1's in the diagonal before trying to make zeroes has greatly helped in furthering my understanding. – Matt Nov 11 '16 at 16:04