I have this system:


And I've done:


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


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?

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

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.

| cite | improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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