4 Solving System Of Linear Equations

Numerical Method · Unit 4 · 8 hrs

Solving System of Linear Equations

Exam-focused notes for Solving System of Linear Equations (Numerical Method, CSC212): what the TU syllabus asks and how it has actually been tested, with 12 solved past questions from this unit.

Solving System of Linear Equations in short

A system of linear equations $A\mathbf{x}=\mathbf{b}$ underlies almost every numerical technique, from curve fitting to differential equations. This chapter develops direct methods that solve such a system in a fixed number of steps (Gaussian elimination, Gauss-Jordan, LU and Cholesky factorization) and iterative methods that refine an initial guess until it converges (Jacobi, Gauss-Seidel, the power method for eigenvalues).

Solving System of Linear Equations: notes

Review of the existence of solutions and properties of matrices

A system $A\mathbf{x}=\mathbf{b}$ with $A$ an $n\times n$ matrix has a unique solution exactly when $A$ is non-singular, that is, $\det(A)\ne 0$, equivalently when $A$ has full rank $n$. If $\det(A)=0$ the system is either inconsistent (no solution, when $\mathbf{b}$ is not in the column space of $A$) or has infinitely many solutions (when it is). A system is called ill-conditioned when small changes in the coefficients or the right-hand side produce disproportionately large changes in the solution; this happens when $A$ is close to singular (its determinant is very small relative to its entries, or two rows/columns are nearly proportional), and it is a property of the problem, not of the method used to solve it. Every numerical method in this chapter assumes $A$ is non-singular and reasonably well-conditioned.

Gaussian elimination method

Gaussian elimination solves $A\mathbf{x}=\mathbf{b}$ by writing the system as an augmented matrix $[A,|,\mathbf{b}]$ and using row operations (adding a multiple of one row to another) to eliminate the unknowns below the diagonal one column at a time, producing an upper-triangular system. The unknowns are then found by back substitution, starting from the last equation (which has only one unknown) and working upward.

Worked example. Solve $$ \begin{aligned} x_1 + x_2 + x_3 &= 4 \ 2x_1 + 3x_2 + 5x_3 &= 8 \ 4x_1 \phantom{+ 0x_2} + x_3 &= 7. \end{aligned} $$

Eliminating $x_1$ from rows 2 and 3 (factors $2$ and $4$ respectively) gives $$ \begin{aligned} x_1 + x_2 + x_3 &= 4 \ x_2 + 3x_3 &= 0 \ -4x_2 - 3x_3 &= -9. \end{aligned} $$

Eliminating $x_2$ from row 3 (factor $-4$) gives $9x_3 = -9$, so $x_3 = -1$. Back substitution then gives $x_2 = 0 - 3(-1) = 3$ and $x_1 = 4 - 3 - (-1) = 2$. The solution is $(x_1,x_2,x_3) = (2, 3, -1)$.

Naive Gaussian elimination algorithm
1. Read the augmented matrix [A | b], size n.
2. For k = 0 to n-2:
     for i = k+1 to n-1:
       factor = A[i][k] / A[k][k]
       for j = k to n:
         A[i][j] = A[i][j] - factor * A[k][j]
3. For i = n-1 down to 0:
     x[i] = A[i][n]
     for j = i+1 to n-1:
       x[i] = x[i] - A[i][j] * x[j]
     x[i] = x[i] / A[i][i]
4. Report x as the solution.

pivoting

Naive Gaussian elimination fails, or loses accuracy badly, whenever the pivot element $A[k][k]$ is zero or very small compared to the other entries in its column, because the elimination factor $A[i][k]/A[k][k]$ then becomes huge and amplifies any rounding error already present. Partial pivoting fixes this by, at each elimination step, searching column $k$ (from row $k$ downward) for the entry of largest magnitude and swapping its row into the pivot position before eliminating.

Worked example. Solve, using only 3 significant digits of arithmetic at every step, $$0.0002x_1 + 2x_2 = 5, \qquad 2x_1 + 2x_2 = 6,$$ whose exact solution is $x_1 = 0.500$, $x_2 = 2.500$. Eliminating naively with row 1 as pivot, the multiplier is $2/0.0002 = 10000$, giving $a_{22}\to 2 - 10000(2) = -20000$ and $b_2 \to 6 - 10000(5) = -50000$ (rounded to 3 significant digits), so $x_2 = -50000/-20000 = 2.50$, but then $x_1 = (5 - 2(2.50))/0.0002 = 0.00/0.0002 = 0.00$: the small pivot has completely destroyed $x_1$. Swapping the two rows first (so the pivot is $2$, the largest entry in the column) gives $a_{22} \to 2 - 0.0001(2) = 2.00$ and $b_2 \to 5 - 0.0001(6) = 5.00$ at 3-digit precision, so $x_2 = 5.00/2.00 = 2.50$ and $x_1 = (6-2(2.50))/2 = 0.500$, recovering the correct answer. Pivoting does not change the exact mathematical solution; it changes which numbers the arithmetic has to divide by, which is what protects the result from round-off.

What this unit covers

  • Review of the existence of solutions and properties of matrices
  • Gaussian elimination method
  • pivoting
  • Gauss-Jordan method
  • Inverse of matrix using Gauss-Jordan method
  • Matrix factorization and Solving System of Linear Equations by using Dolittle and Cholesky's algorithm
  • Iterative Solutions of System of Linear Equations
  • Jacobi Iteration Method
  • Gauss-Seidal Method
  • Eigen values and eigen vectors problems
  • Solving eigen value problems using power method

Jacobi Iteration Method

2081 · 10 marks

What are the limitations of direct methods for solving a system of linear equations? How does Gauss Seidel method differ from Jacobi iteration? Solve the following system of linear equations using Jacobi iteration method:

$$ \begin{aligned} 2x - 7y - 10z &= -17 \ 5x + y + 3z &= 14 \ x + 10y + 9z &= 7 \end{aligned} $$

[10]

Show solved answer

Limitations of Direct Methods, Gauss-Seidel vs Jacobi, and Jacobi Iteration


Part 1: Limitations of Direct Methods

Direct methods (Gauss Elimination, LU Decomposition, Cramer's Rule) obtain the solution in a finite number of steps, but have limitations:

  1. High computational cost: Gauss Elimination needs about $O(n^3)$ operations; expensive for large $n$.
  2. Round-off error accumulation: Fixed long sequences of operations let rounding errors propagate.
  3. Large memory needs: Full matrix storage is required.
  4. Poor for sparse systems: Fill-in destroys sparsity, wasting memory and time.
  5. Pivoting problems: Zero or small pivots cause failure or instability without pivoting.
  6. Hard to parallelize: Inherently sequential.

Part 2: Gauss-Seidel vs Jacobi

FeatureJacobiGauss-Seidel
Values usedOnly previous iteration valuesMost recent updated values immediately
StorageNeeds old and new arraysSingle array (in-place)
ConvergenceSlowerFaster (≈ twice)
ParallelismEasyHarder

Formulas: $$x_i^{(k+1)} = \frac{1}{a_{ii}}\Big(b_i - \sum_{j\neq i} a_{ij}x_j^{(k)}\Big)\quad\text{(Jacobi)}$$ $$x_i^{(k+1)} = \frac{1}{a_{ii}}\Big(b_i - \sum_{j<i} a_{ij}x_j^{(k+1)} - \sum_{j>i} a_{ij}x_j^{(k)}\Big)\quad\text{(Gauss-Seidel)}$$


Part 3: Jacobi Iteration Solution

Given System

$$2x - 7y - 10z = -17 \quad (1)$$ $$5x + y + 3z = 14 \quad (2)$$ $$x + 10y + 9z = 7 \quad (3)$$

Step 1: Rearrange for Diagonal Dominance

Swap to place dominant coefficients on the diagonal: $$5x + y + 3z = 14 \quad (1')$$ $$x + 10y + 9z = 7 \quad (2')$$ $$2x - 7y - 10z = -17 \quad (3')$$

Check:

  • Row 1: $|5|=5 > 1+3=4$ ✓
  • Row 2: $|10|=10 = 1+9=10$ (borderline, acceptable)
  • Row 3: $|-10|=10 > 2+7=9$ ✓

Step 2: Iteration Formulas

$$x^{(k+1)} = \tfrac{1}{5}\big(14 - y^{(k)} - 3z^{(k)}\big)$$ $$y^{(k+1)} = \tfrac{1}{10}\big(7 - x^{(k)} - 9z^{(k)}\big)$$ $$z^{(k+1)} = \tfrac{1}{10}\big(17 + 2x^{(k)} - 7y^{(k)}\big)$$

Step 3: Iterations (start $x^{(0)}=y^{(0)}=z^{(0)}=0$)

Iteration 1: $$x^{(1)} = \tfrac{1}{5}(14) = 2.8$$ $$y^{(1)} = \tfrac{1}{10}(7) = 0.7$$ $$z^{(1)} = \tfrac{1}{10}(17) = 1.7$$

Iteration 2: $$x^{(2)} = \tfrac{1}{5}(14 - 0.7 - 3(1.7)) = \tfrac{1}{5}(14 - 0.7 - 5.1) = \tfrac{8.2}{5} = 1.64$$ $$y^{(2)} = \tfrac{1}{10}(7 - 2.8 - 9(1.7)) = \tfrac{1}{10}(7 - 2.8 - 15.3) = \tfrac{-11.1}{10} = -1.11$$ $$z^{(2)} = \tfrac{1}{10}(17 + 2(2.8) - 7(0.7)) = \tfrac{1}{10}(17 + 5.6 - 4.9) = \tfrac{17.7}{10} = 1.77$$

Iteration 3: $$x^{(3)} = \tfrac{1}{5}(14 - (-1.11) - 3(1.77)) = \tfrac{1}{5}(14 + 1.11 - 5.31) = \tfrac{9.8}{5} = 1.96$$ $$y^{(3)} = \tfrac{1}{10}(7 - 1.64 - 9(1.77)) = \tfrac{1}{10}(7 - 1.64 - 15.93) = \tfrac{-10.57}{10} = -1.057$$ $$z^{(3)} = \tfrac{1}{10}(17 + 2(1.64) - 7(-1.11)) = \tfrac{1}{10}(17 + 3.28 + 7.77) = \tfrac{28.05}{10} = 2.805$$

Iteration 4: $$x^{(4)} = \tfrac{1}{5}(14 + 1.057 - 3(2.805)) = \tfrac{1}{5}(14 + 1.057 - 8.415) = \tfrac{6.642}{5} = 1.3284$$ $$y^{(4)} = \tfrac{1}{10}(7 - 1.96 - 9(2.805)) = \tfrac{1}{10}(7 - 1.96 - 25.245) = \tfrac{-20.205}{10} = -2.0205$$ $$z^{(4)} = \tfrac{1}{10}(17 + 2(1.96) - 7(-1.057)) = \tfrac{1}{10}(17 + 3.92 + 7.399) = \tfrac{28.319}{10} = 2.8319$$

Iteration 5: $$x^{(5)} = \tfrac{1}{5}(14 + 2.0205 - 3(2.8319)) = \tfrac{1}{5}(14 + 2.0205 - 8.4957) = \tfrac{7.5248}{5} = 1.505$$ $$y^{(5)} = \tfrac{1}{10}(7 - 1.3284 - 9(2.8319)) = \tfrac{1}{10}(7 - 1.3284 - 25.4871) = \tfrac{-19.8155}{10} = -1.9816$$ $$z^{(5)} = \tfrac{1}{10}(17 + 2(1.3284) - 7(-2.0205)) = \tfrac{1}{10}(17 + 2.6568 + 14.1435) = \tfrac{33.8003}{10} = 3.380$$

Observation on Convergence

The iterates are oscillating and not settling quickly:

kxyz
12.800.701.70
21.64-1.111.77
31.96-1.0572.805
41.328-2.0212.832
51.505-1.9823.380

The values are drifting rather than converging tightly. This is because Row 2 is only borderline dominant ($|10| = |1| + |9|$), so strict diagonal dominance is not satisfied, and Jacobi converges very slowly (borderline behavior).

Exact Solution (for reference)

Solving the system directly gives: $$x = 1,\quad y = -2,\quad z = 3$$

The Jacobi iterates ($x\to$ near 1.5, $y\to$ near $-2$, $z\to$ near 3) are drifting toward the neighborhood of this solution but require many more iterations owing to the borderline dominance.

Final result (converged / exact): $x = 1,\ y = -2,\ z = 3$.

Open this answer on its own page →

Gauss-Jordan method

2081 · 5 marks

Solve the following system of linear equations using Gauss-Jordan elimination method:

$$ \begin{aligned} x + 2y - 3z &= 4 \ 2x + 4y - 6z &= 8 \ x - 2y + 5z &= 4 \end{aligned} $$

[5]

Show solved answer

Gauss-Jordan Elimination Method

Given Data

System of equations: $$x + 2y - 3z = 4 \quad \cdots (1)$$ $$2x + 4y - 6z = 8 \quad \cdots (2)$$ $$x - 2y + 5z = 4 \quad \cdots (3)$$

Step 1: Augmented Matrix

$$[A|b] = \begin{bmatrix} 1 & 2 & -3 & | & 4 \ 2 & 4 & -6 & | & 8 \ 1 & -2 & 5 & | & 4 \end{bmatrix}$$

Step 2: Eliminate column 1 below pivot

$R_2 \to R_2 - 2R_1$: $[0,\ 0,\ 0,\ |\ 0]$

$R_3 \to R_3 - R_1$: $[0,\ -4,\ 8,\ |\ 0]$

$$\begin{bmatrix} 1 & 2 & -3 & | & 4 \ 0 & 0 & 0 & | & 0 \ 0 & -4 & 8 & | & 0 \end{bmatrix}$$

Step 3: Swap $R_2 \leftrightarrow R_3$

$$\begin{bmatrix} 1 & 2 & -3 & | & 4 \ 0 & -4 & 8 & | & 0 \ 0 & 0 & 0 & | & 0 \end{bmatrix}$$

Step 4: Normalize Row 2 ($R_2 \to R_2 / (-4)$)

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

Step 5: Eliminate column 2 above pivot ($R_1 \to R_1 - 2R_2$)

$R_1: [1,\ 0,\ 1,\ |\ 4]$

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

Step 6: Interpretation

Row 3 gives $0 = 0$, which is consistent. Rank of coefficient matrix $= 2 <$ number of unknowns $= 3$, so there are infinitely many solutions.

Let $z = t$ (free parameter, $t \in \mathbb{R}$).

From Row 2: $y - 2t = 0 \implies y = 2t$

From Row 1: $x + t = 4 \implies x = 4 - t$

Verification with equation (3): $x - 2y + 5z = (4-t) - 2(2t) + 5t = 4 - t - 4t + 5t = 4$ ✓

Final Answer

$$x = 4 - t, \quad y = 2t, \quad z = t, \quad t \in \mathbb{R}$$

The system has infinitely many solutions since equation (2) $= 2 \times$ equation (1), reducing to two independent equations in three unknowns.

Open this answer on its own page →

2080 · 10 marks

How Gauss Jordan method differs from Gauss Elimination method? Solve the following system of equations using Gauss Jordan method. How can we use Gauss Jordan method to find the inverse of a matrix? Discuss.

$$ \begin{aligned} 2x - y + 4z &= 15 \ 2x + 3y - 2z &= 4 \ 3x + 2y - 4z &= -4 \end{aligned} $$

[10]

System of equations: $$2x - y + 4z = 15 \quad (1)$$ $$2x + 3y - 2z = 4 \quad (2)$$ $$3x + 2y - 4z = -4 \quad (3)$$ All coefficients and constants are present. Solvable in full. --- Feature Gauss Elimination Gauss Jordan --------- Final form Upper triangular Diagonal / identity Back substitution R...

Open this answer on its own page →

2078 · 5 marks

Solve the following set of linear equations using the Gauss-Jordan method.

$$x_2 + 2x_3 + 3x_4 = 9$$ $$7x_1 + 6x_2 + 5x_3 + 4x_4 = 33$$ $$8x_1 + 9x_2 + x_4 = 27$$ $$2x_1 + 5x_2 + 4x_3 + 3x_4 = 23$$

[5]

$$ \begin{aligned} x2 + 2x3 + 3x4 &= 9 \quad (1)\ 7x1 + 6x2 + 5x3 + 4x4 &= 33 \quad (2)\ 8x1 + 9x2 + 0x3 + x4 &= 27 \quad (3)\ 2x1 + 5x2 + 4x3 + 3x4 &= 23 \quad (4) \end{aligned} $$ $$ \left[\begin{array}{ccccc} 0 & 1 & 2 & 3 & 9 \ 7 & 6 & 5 & 4 & 33 \ 8 & 9 & 0 & 1 & 27 \ 2 & 5 & 4 & 3 & 2...

Open this answer on its own page →

Matrix factorization and Solving System of Linear Equations by using Dolittle and Cholesky's algorithm

2080 · 5 marks

Factorise the following matrix using Cholesky method. $$\begin{bmatrix} 2 & 1 & 1 \ 3 & 2 & 3 \ 1 & 4 & 9 \end{bmatrix}$$ [5]

$$A = \begin{bmatrix} 2 & 1 & 1 \ 3 & 2 & 3 \ 1 & 4 & 9 \end{bmatrix}$$ Cholesky's method requires the matrix to be symmetric (and positive definite), factorising it as: $$A = L L^T$$ where $L$ is lower triangular. The given matrix is NOT symmetric since $a{12} = 1 \ne a{21} = 3$,

Open this answer on its own page →

2078 · 10 marks

Matrix Factorization and Solving Linear Systems

Matrix factorization expresses a square matrix $A$ as a product of two triangular matrices: $$A = LU$$ where $L$ is lower triangular (with unit diagonal in Doolittle's method) and $U$ is upper triangular. This is called LU decomposition. $$A = \begin{bmatrix} 1 & 0 & 0 \ l{21} & 1 & 0 \ l{31} &...

Open this answer on its own page →

2077 · 5 marks

Discuss the Doolittle LU decomposition method for matrix factorization. [5]

The coefficient matrix A of a system of linear equations can be decomposed (factorized) into two triangular matrices L (lower triangular) and U (upper triangular) such that: $$A = L \cdot U$$ $$L = \begin{bmatrix} 1 & 0 & 0 \ l{21} & 1 & 0 \ l{31} & l{32} & 1 \end{bmatrix}, \quad U = \begin{bma...

Open this answer on its own page →

2075 · 10 marks

Matrix Factorization and LU Decomposition

Matrix factorization (decomposition) means expressing a matrix $A$ as a product of two or more matrices. In LU decomposition, $A = LU$, where $L$ is lower triangular and $U$ is upper triangular. The Doolittle method fixes the diagonal of $L$ to be all 1's. It is used to solve $Ax=b$ efficiently: ...

Open this answer on its own page →

pivoting

2079 · 10 marks

What is pivoting? Why is it necessary? Write an algorithm and program to solve the set of n linear equations using Gaussian elimination method.[10]

Pivoting is the process of rearranging (swapping) rows (or columns) of an augmented matrix during Gaussian elimination so that the element used as the divisor (pivot element) in each forward elimination step is the largest possible value in absolute magnitude among the available candidates. In pa...

Open this answer on its own page →

2077 · 10 marks

Why partial pivoting is used with Naive Gauss Elimination method? Solve the following system of equations using Gauss Elimination method with partial pivoting? How Gauss Jordan method differs from Gauss elimination method? $2x + 2y - z = 6$, $4x + 2y + 3z = 4$, $x + y + z = 0$ [10]

System of equations: $$2x + 2y - z = 6 \quad \cdots (1)$$ $$4x + 2y + 3z = 4 \quad \cdots (2)$$ $$x + y + z = 0 \quad \cdots (3)$$ Sub-questions: (a) why partial pivoting, (b) solve by Gauss elimination with partial pivoting, (c) difference between Gauss-Jordan and Gauss elimination. --- The Naiv...

Open this answer on its own page →

Gauss-Seidal Method

2079 · 5 marks

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]

Show solved answer

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$
0000
12.6667-0.66670.8889
22.3704-1.25931.3827
32.3539-1.95881.8546
42.4270-2.84952.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.

Open this answer on its own page →

2075 · 5 marks

Solve the following set of equations using Gauss Seidel method.

$$ \begin{aligned} x + 2y + 3z &= 4 \ 6x - 4y + 5z &= 10 \ 5x + 2y + 2z &= 25 \end{aligned} $$

[5]

System of equations: $$x + 2y + 3z = 4 \quad \cdots (1)$$ $$6x - 4y + 5z = 10 \quad \cdots (2)$$ $$5x + 2y + 2z = 25 \quad \cdots (3)$$ Initial guess (standard): $x^{(0)} = y^{(0)} = z^{(0)} = 0$. To apply Gauss-Seidel we solve equation $(i)$ for $x$, $(j)$ for $y$, $(k)$ for $z$. To improve the ...

Open this answer on its own page →