# Reduce a matrix to row-echelon form with partial pivoting

Use the Gaussian elimination with partial pivoting manually to reduce the following matrix to row echelon form:

$$\begin{bmatrix} 1 & 0 & 0 & 0 & 1 \\ -1 & 1 & 0 & 0 & 1 \\ -1 & -1 & 1 & 0 & 1 \\ -1 & -1 & -1 & 1 & 1 \\ -1 & -1 & -1 & -1 & 1 \\ \end{bmatrix}$$

I did the following operations:

1. $R_2 \to R_2 – (\frac{a_{kj}}{a_{ij}})R_1$ where $a_{ij} \neq 0, k > i$ and $i, k$ are rows.

2. $R_2 \leftrightarrow R_4$

3. $R_3 \to R_3 – (\frac{a_{kj}}{a_{ij}})R_2$

4. $R_3 \leftrightarrow R_5$

5. $R_3 \to R_3 – (\frac{a_{kj}}{a_{ij}})R_2$

6. $R_3 \leftrightarrow R_4$

7. $R_2 \to R_2 – (\frac{a_{kj}}{a_{ij}})R_1$

8. $R_3 \to R_3 – (\frac{a_{kj}}{a_{ij}})R_2$

So, the resultant matrix is:

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

If my calculations are correct, can I claim that I reduced the matrix correctly? Thanks.

• What happens if you just add row 1 to all other row? Can you see a nice pattern emerging? Feb 5, 2016 at 20:46
• The leftmost column will be all zeros except the entry $(1, 1)$ which is $1$ and the rightmost one will be all twos except for $(1, 5)$ which is $1$? If that's correct, do we swap any rows? Feb 5, 2016 at 20:57
• You have cleared the first column. Is there any reason to be unhappy with the pivot in position (2,2)? Apart from the changes to the last column then new 4 by 4 lower right corner of your matrix is very similar to the original matrix! Feb 5, 2016 at 21:01
• I see the pattern, but I am not seeing why we should use partial pivoting here which calls for row swapping? Feb 5, 2016 at 21:09
• Precisely! There is no need for you to pivot in this problem. You can (correctly) say that you used Gaussian elimination with partial pivoting, but that discovered along the way that you did not need to actually pivot. Feb 5, 2016 at 21:11