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

140 Views Asked by At

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…

2

There are 2 best solutions below

1
On 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.

0
On

You want to add $-1/3$ times the first row to the second. Looking at the second entry there you have $\frac{-1}{3} (-1)$ and you want to add that to the entry right below the $-1$, which is in position $(1,2)$, i.e., $-1$ in position $(2,2)$.

I.e., the entry in the $(2,2)$ position becomes $-1+\frac{1}{3}=\frac{-2}{3}$, and not $\frac{-1}{3}$ as you claimed.

Similarly for all other entries.