CSC212 · 2079 · 5 marks
Solve the following set of equations using Gauss Siedal method.
Solve the following set of equations using Gauss Siedal method.
$$ \begin{aligned} x + 2y + 3z &= 4 \ 6x + 4y + 5z &= 16 \ 5x + 2y + 3z &= 12 \end{aligned} $$
[5]
Gauss-Seidel Method
Given
The system of equations: $$x + 2y + 3z = 4 \quad \text{...(1)}$$ $$6x + 4y + 5z = 16 \quad \text{...(2)}$$ $$5x + 2y + 3z = 12 \quad \text{...(3)}$$
Initial guess (standard assumption): $x^{(0)} = y^{(0)} = z^{(0)} = 0$.
Solution
Analysis of Diagonal Dominance
For Gauss-Seidel to converge reliably, we should try to arrange the largest coefficients on the diagonal. Examine:
- Coefficient of $x$: largest in (2) and (3), both equal to 6 and 5.
- Coefficient of $y$: largest is 4 (in eq 2).
- Coefficient of $z$: largest is 5 (in eq 2).
The largest coefficients cluster in equation (2), so a clean diagonally dominant arrangement is not possible. This is a poorly conditioned system for Gauss-Seidel. However, following the standard exam approach (partial pivoting), we rearrange to place the largest coefficient in each row on the diagonal.
Rearranged system:
$$6x + 4y + 5z = 16 \Rightarrow x = \frac{16 - 4y - 5z}{6}$$ $$5x + 2y + 3z = 12 \Rightarrow y = \frac{12 - 5x - 3z}{2}$$ $$x + 2y + 3z = 4 \Rightarrow z = \frac{4 - x - 2y}{3}$$
Iteration 1 (from $x=y=z=0$)
$$x = \frac{16 - 0 - 0}{6} = 2.6667$$ $$y = \frac{12 - 5(2.6667) - 0}{2} = \frac{12 - 13.3333}{2} = -0.6667$$ $$z = \frac{4 - 2.6667 - 2(-0.6667)}{3} = \frac{4 - 2.6667 + 1.3333}{3} = \frac{2.6667}{3} = 0.8889$$
Iteration 2
$$x = \frac{16 - 4(-0.6667) - 5(0.8889)}{6} = \frac{16 + 2.6667 - 4.4444}{6} = \frac{14.2222}{6} = 2.3704$$ $$y = \frac{12 - 5(2.3704) - 3(0.8889)}{2} = \frac{12 - 11.8519 - 2.6667}{2} = \frac{-2.5185}{2} = -1.2593$$ $$z = \frac{4 - 2.3704 - 2(-1.2593)}{3} = \frac{4 - 2.3704 + 2.5185}{3} = \frac{4.1481}{3} = 1.3827$$
Iteration 3
$$x = \frac{16 - 4(-1.2593) - 5(1.3827)}{6} = \frac{16 + 5.0370 - 6.9136}{6} = \frac{14.1235}{6} = 2.3539$$ $$y = \frac{12 - 5(2.3539) - 3(1.3827)}{2} = \frac{12 - 11.7696 - 4.1481}{2} = \frac{-3.9177}{2} = -1.9588$$ $$z = \frac{4 - 2.3539 - 2(-1.9588)}{3} = \frac{4 - 2.3539 + 3.9177}{3} = \frac{5.5638}{3} = 1.8546$$
Iteration 4 (check on convergence)
$$x = \frac{16 - 4(-1.9588) - 5(1.8546)}{6} = \frac{16 + 7.8353 - 9.2730}{6} = \frac{14.5623}{6} = 2.4270$$ $$y = \frac{12 - 5(2.4270) - 3(1.8546)}{2} = \frac{12 - 12.1352 - 5.5638}{2} = \frac{-5.6990}{2} = -2.8495$$ $$z = \frac{4 - 2.4270 - 2(-2.8495)}{3} = \frac{4 - 2.4270 + 5.6990}{3} = \frac{7.2720}{3} = 2.4240$$
Summary Table
| Iteration | $x$ | $y$ | $z$ |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 2.6667 | -0.6667 | 0.8889 |
| 2 | 2.3704 | -1.2593 | 1.3827 |
| 3 | 2.3539 | -1.9588 | 1.8546 |
| 4 | 2.4270 | -2.8495 | 2.4240 |
Important Observation on Convergence
The iterates are diverging, not converging. The values of $y$ move $-0.67 \to -1.26 \to -1.96 \to -2.85$ and $z$ moves $0.89 \to 1.38 \to 1.85 \to 2.42$; the gaps are growing, not shrinking. This confirms the earlier note that the system is not diagonally dominant and no rearrangement makes it so, so Gauss-Seidel does not converge here.
Exact solution (by direct elimination, subtracting (1) from (3): $4x = 8 \Rightarrow x = 2$; then $2y + 3z = 2$ and $4y + 5z = 4$, giving $y = -1,\ z = ...$). Solving:
- From $4x=8$: $x = 2$.
- $2y + 3z = 4 - 2 = 2$.
- $4y + 5z = 16 - 12 = 4$.
- Multiply first by 2: $4y + 6z = 4$; subtract: $z = 0$, then $2y = 2 \Rightarrow y = 1$.
So the true solution is $x = 2,\ y = 1,\ z = 0$. The Gauss-Seidel iterates ($x\approx 2.4,\ y\approx -2.8,\ z\approx 2.4$) are moving away from this, confirming divergence.
Final Result
The iterations up to iteration 3 and 4 are as tabulated. The method does not converge here: the iterates move away from the exact solution $x=2,\ y=1,\ z=0$, so any claim that it settles near $x=2,\ y=-2,\ z=2$ would be wrong.
Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.