Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I have this system:

$\begin{align*}x+2y-z=1\\x+y+z=2\\2x-y+2z=3\end{align*}$

And I've done:

$\begin{array}{ccc|ccc}1&2&-1&1&0&0\\1&1&1&0&1&0\\2&-1&2&0&0&1\end{array}$

then multiply first row by $(-1)$ in order to make the (lin:2, col:1) 0. and I get:

$\begin{array}{ccc|ccc}1&2&-1&1&0&0\\0&-1&2&-1&1&0\\0&-5&0&-2&0&1\end{array}$

now I have to switch the line 2 with 3 or the col 2 with 3? (because there is a zero on the main diagonal)

If I switch, then how my variable will be switched?

share|improve this question
    
Have you tried continuing to see what happens? –  J. M. Nov 19 '11 at 18:18
    
None of them gives me the right result.. –  Totty Nov 19 '11 at 18:47
    
Maybe because the first row should be $1,2,-1$ instead of $1,2,1$? –  J. M. Nov 19 '11 at 18:50
    
there was a typo when I've wrote here. as you see in the second step that is right. –  Totty Nov 19 '11 at 19:00
1  
You should not exchange columns; but you can exchange rows. –  Arturo Magidin Nov 19 '11 at 20:02

1 Answer 1

up vote 4 down vote accepted

Member of the Answering the unanswered ones party here :)

Suppose you have the equation $Ax=b$, every time you make an elemantary row operation you are actually multiplying with a matrix that represents this action. Example: you have performed one such action, multiplying the first row with $-1$ and adding it to the second row and multiplying the first row with $-2$ and adding it to the third row which is: $$ \pmatrix{1 &0 &0\\-1 &1 &0\\-2&0&1}Ax=\pmatrix{1 &0 &0\\-1 &1 &0\\-2&0&1}b $$ That is the reason why it shows up on the right part of your matrix. If you keep doing this you would get $$ R_n\ldots R_1Ax= R_n\ldots R_1 b $$ and $R_n\ldots R_1A$ would be an upper triangular matrix from which you can start back substitution. Hence you wouldn't be needing the column swaps at all.

The column swap can be seen by rewriting the $Ax=b$ as $APP^{-1}x = b$. This means that whenever you apply a column swap, your variables are also permuted with the inverse of the permutation matrix. The inverse of a permutation is $\ldots$ehm$\dots$ permuting back, hence easy to obtain. Suppose we apply a column swap between the column number $2$ and $3$, $$ \underbrace{\left(\begin{array}{ccc}1&2&-1\\1&1&1\\2&-1&2\end{array}\right)\pmatrix{1 &0 &0\\0 &0 &1\\0 &1&0}}_{AP} \underbrace{\pmatrix{1 &0 &0\\0 &0 &1\\0 &1&0}\pmatrix{x\\y\\z}}_{P^{-1}x} = b $$ which is equal to $$ \left(\begin{array}{ccc}1&-1&2\\1&1&1\\2&2&-1\end{array}\right)\pmatrix{x\\z\\y} = b $$ we can see that $b$ couldn't care less about this operation. Hence, column swap only results with more things that we have to care about (In the context of solving linear equations!). For example you can continue your work by adding $-5$ times the second row and add it to the third and you are done.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.