# Solving systems of equations using matrices

I'm teaching myself how to solve systems of equations using matrices and row operations. I get the basic mechanics of it (legal operations, etc.), but it seems like it's kind-of a crapshoot deciding where to begin, and choosing the "wrong" operation to start with can lead to a really difficult problem.

My question is: Are there any rules of thumb for deciding which operations to begin with and how to proceed?

For instance, given the system:

2x - 9y - z = -23
x + 9y - 5z= 2
3x + y + z = 24


What row operation would you begin with, and where would you go from there? I'm not asking you to do it for me, but for insight into your thought process regarding how to proceed.

-

Try following these steps (practice a bunch of them and you start seeing approaches, but there are no hard and fast rules on what is optimal).

• Swap R1 and R3
• Subtract (1/3) R1 from R2
• Multiply R2 by (3/2)
• Multiply R3 by -1
• Add (2/3) R1 to R3
• Multiply R3 by 3
• Swap R2 with R3
• Subtract (13/29) R2 from R3
• Multiply R3 by (-29/297)
• Subtract 5*R3 from R2
• Subtract R3 from R1
• Subtract (1/29) R2 from R1
• Divide R1 by 3
• Divide R2 by 29

You will end up with:

$$\left[\begin{array}{ccc|c} 1 & 0 & 0 & 5\\0 & 1 & 0 & 3\\0 & 0 & 1 & 6 \end{array}\right]$$

-
Nice work/handy recipe to follow ;-) – amWhy May 16 '13 at 5:09

JavaMan is right that the algorithm works.

But if you're just looking for rules of thumb: the $-z$ and $+z$ in the first and third rows jump out at me -- adding one row to the other will create a zero. Ditto for $-9y$ and $+9y$. To leverage both of those, you need to add the first row to the second row, then to the third row. That should get you well on your way.

-

There is an algorithm for this process called Gauss-Jordan elimination.

Applying Gauss-Jordan to the example given:

1) The first step is to get a leading one in the first row of your matrix. The easiest way to do this is to switch rows 1 and 2. This gives the matrix

$$\left[\begin{array}{ccc|c} 1 & 9 & -5 & 2 \\ 2 & -9 & -1 & -23 \\ 3 & 1 & 1 & 24 \end{array}\right]$$

2) Next, since you have a leading 1 in the first row, add multiples of the first row to all other rows so that ll other entries in the first column are zero.

3) Then apply the same process on column 2. That is, get a leading one in the second row if possible...

-
Yes, but my question concerns how to execute the algorithm, when the order of operations is not readily apparent by looking at the augmented matrix. – aqaeous May 16 '13 at 4:31
I'm not sure I understand what you mean. Gauss-Jordan gives you a method for reducing all augmented matrices regardless of how messy the matrix. In other words, if you always follow the steps of Gauss-Jordan, you will eventually arrive at a matrix which is in reduced row echelon form. – JavaMan May 16 '13 at 4:33