# Gauss-Jordan Elimination

1. Dec 14, 2015

By using row operation, how can

$\left( \begin{array}{rrrr|r} 2 & 0 & -1 & 0 & 0 \\ 6 & 0 & 0 & -2 & 0 \\ 0 & 2 & -2 & -1 & 0 \end{array} \right)$

be

$\left( \begin{array}{rrrr|r} 1 & 0 & 0 & -\frac{1}{3} & 0 \\ 0 & 1 & 0 & -\frac{7}{6} & 0 \\ 0 & 0 & 1 & -\frac{2}{3} & 0 \end{array} \right)$

???

I am trying to write my attempt on this problem but I don't know how to write matrix with row operation in Latex. Please show me example.

2. Dec 14, 2015

### BvU

There's a link to the LateX Tutorial in the homework guidelines and an extensive one in general math.
Is there a speecific question you need answered ?

Your matrix looks rather straightforward to me:
Subtract 1/3 x row 2 from row 1 to get 2 x new row 3.
Add row 1 to new row 3 to get 2 x new row 1
Add 2 x new row 3 to row 3 to get 2 x new row 2

But I expect you already found this ? If so where do you get stuck ?

--

3. Dec 14, 2015

### HallsofIvy

Staff Emeritus
Mod note: Corrected what appeared to be a typo in the second vector, below. I'm almost certain that the corrected version was what was intended.
It should be obvious, seeing $\begin{pmatrix}0 \\ 0 \\ 2 \end{pmatrix}$ in the middle column of the original matrix and $\begin{pmatrix} 0 \\ 1 \\ 0 \end{pmatrix}$ in the result you want, that you will want to swap the second and third rows. If you do that as the first step, you get $$\left(\begin{array}{cccc|c} 2 & -1 & 0 & 1 & 0 \\ 0 & 2 & -2 & -1 & 0 \\ 6 & 0 & 0 & -2 & 0 \end{array}\right)$$.

The rest should be easy.

Last edited by a moderator: Dec 14, 2015
4. Dec 14, 2015

Could you write it in matrix rather than words? I am confuse.

My attempt is:

$\left( \begin{array}{rrrr|r} 2 & 0 & -1 & 0 & 0 \\ 6 & 0 & 0 & -2 & 0 \\ 0 & 2 & -2 & -1 & 0 \end{array} \right)$

R1 divided by 2, R2 swap to R3, then I get

$\left( \begin{array}{rrrr|r} 1 & 0 & -\frac{1}{2} & 0 & 0 \\ 0 & 2 & -2 & -1 & 0 \\ 6 & 0 & 0 & -2 & 0 \end{array} \right)$

R2 divided by 2, then I get

$\left( \begin{array}{rrrr|r} 1 & 0 & -\frac{1}{2} & 0 & 0 \\ 0 & 1 & -1 & -\frac{1}{2} & 0 \\ 6 & 0 & 0 & -2 & 0 \end{array} \right)$

R3 - 6R1, then I get lower triangular matrix

$\left( \begin{array}{rrrr|r} 1 & 0 & -\frac{1}{2} & 0 & 0 \\ 0 & 1 & -1 & -\frac{1}{2} & 0 \\ 0 & 0 & 3 & -2 & 0 \end{array} \right)$

Why the result is different?

Last edited: Dec 14, 2015
5. Dec 14, 2015

### BvU

Which one is confusing you ?

Subtract 1/3 x row 2 from row 1 to get 2 x new row 3 is so clear to me that I don't know how to simplify it!
Perhaps:

Subtract 1/3 x row 2 from row 1 to and divide the resulting row by -2 to get new row 3 ​
?

6. Dec 15, 2015

Could you write it in my style as above.

7. Dec 15, 2015

### BvU

I could, but if it is unclear the way I write it now, you still have a problem. What is it that makes it undecipherable for you ?

8. Dec 15, 2015

You said "Subtract 1/3 x row 2 from row 1..."

If written by R1 = row 1, R2 = row 2, which one of below is correct according your above statement?

1/3*R2 - R1

or

R1 - 1/3*R2

9. Dec 15, 2015

### BvU

R1 - 1/3*R2

Gives you $(0,0,-1, {2\over 3})$ which is minus the new row 3. (new meaning: as in the final answer)

So not +2 or -2 x new row 3 as I stupidly typed - twice . I fixed the - sign in post #5 and now I fix the 2 that should have been a 1.

Sorry for the mistakes. No wonder you get confused.

10. Dec 15, 2015

OK, R1 - 1/3*R2 give me

$\left( \begin{array}{rrrr|r} 0 & 0 & -1 & \frac{2}{3} & 0 \\ 6 & 0 & 0 & -2 & 0 \\ 0 & 2 & -2 & -1 & 0 \end{array} \right)$

Now, what is the next step?

11. Dec 15, 2015

### BvU

From what you post now (#10): line 3 minus 2 x line 1 is $(0,2,0,-7/3)$, then divide by 2 to get line 2 in the answer in post #1.

12. Dec 15, 2015

Why the result is different with the post #4?

13. Dec 16, 2015

### Svein

In that post you have not finished the computations!

14. Dec 16, 2015

How to finish it? Please tell step-by-step.

Here is my step:

$\left( \begin{array}{rrrr|r} 1 & 0 & -\frac{1}{2} & 0 & 0 \\ 0 & 1 & -1 & -\frac{1}{2} & 0 \\ 0 & 0 & 3 & -2 & 0 \end{array} \right)$

R3 / 3

$\left( \begin{array}{rrrr|r} 1 & 0 & -\frac{1}{2} & 0 & 0 \\ 0 & 1 & -1 & -\frac{1}{2} & 0 \\ 0 & 0 & 1 & -\frac{2}{3} & 0 \end{array} \right)$

The matrix is already in form of Lower triangular matrix, how to obtain the upper triangular matrix?

What next?

15. Dec 16, 2015

### Staff: Mentor

Use the bottom row (3rd column entry) to eliminate the entries directly above it.

Some notation I have seen is this:
$R_2$ ← $R_2 + R_3$
$R_1$ ← $R_1 + \frac 1 2 R_3$
The arrow, ←, means "is replaced by".

16. Dec 17, 2015

OK, I rewrite it with matrix

$\left( \begin{array}{rrrr|r} 1 & 0 & -\frac{1}{2} & 0 & 0 \\ 0 & 1 & -1 & -\frac{1}{2} & 0 \\ 0 & 0 & 1 & -\frac{2}{3} & 0 \end{array} \right)$

$R_2$ ← $R_2 + R_3$

$\left( \begin{array}{rrrr|r} 1 & 0 & -\frac{1}{2} & 0 & 0 \\ 0 & 1 & 0 & -\frac{7}{6} & 0 \\ 0 & 0 & 1 & -\frac{2}{3} & 0 \end{array} \right)$

$R_1$ ← $R_1 + \frac 1 2 R_3$

$\left( \begin{array}{rrrr|r} 1 & 0 & 0 & -\frac{2}{6} & 0 \\ 0 & 1 & 0 & -\frac{7}{6} & 0 \\ 0 & 0 & 1 & -\frac{2}{3} & 0 \end{array} \right)$

17. Dec 17, 2015

Well done !