Gaussian Elimination with Partial Pivoting (what am I doing wrong?)

gaussian eliminationmatricesmatrix equations

This should be a simple question Im using gaussian elimination with pivoting to solve
$$\left[\begin{array}{rrr|r}
2 & 1 & 0 & 3 \\
1 & -1 & 4 & -4 \\
3 & -1 & -2 & 4
\end{array}\right]$$

First I switch Rows 1 & 3
$$\left[\begin{array}{rrr|r}
3 & -1 & -2 & 4 \\
1 & -1 & 4 & -4 \\
2 & 1 & 0 & 3
\end{array}\right]$$

Next step is $E_2 – E_1/3 = E_2$.


So I get
$$\left[\begin{array}{rrr|r}
3 & -1 & -2 & 4 \\
0 & -1/3 & 16/3 & -2/3 \\
2 & 1 & 0 & 3
\end{array}\right]$$

But the notes from my professor for the second step
are
$$\left[\begin{array}{rrr|r}
3 & -1 & -2 & 4 \\
0 & -2/3 & 14/3 & -16/3 \\
2 & 1 & 0 & 3
\end{array}\right]$$

What am I doing wrong? I can’t find my arithmetic mistake…

Best Answer

The second line becomes $\left[\begin{array}{ccc|c} 1-1 & -1 - (-1/3) & 4 - (-2/3) & -4 -4/3 \end{array}\right]$.

We have $1-1=0,\, -1 - (-1/3) = -1 +1/3 = -2/3,\, 4-(-2/3)=4+2/3=12/3+2/3=14/3,\,-4-4/3=-12/3-4/3=-16/3$.

Thus, your professor was correct for all of them.

Related Question