NM
BCA-5004: Unit IV
Linear Systems & Iterations
🏠
Subject: BCA-5004 ⭐ High Weightage (15–20 Marks) Day 4 Priority

Unit IV: Solution of Linear Equations

Direct Methods vs Iterative Methods, Gaussian Elimination with Partial Pivoting, Matrix Notation, and Gauss-Seidel Method with Diagonal Dominance.

1. Systems of Linear Equations: Direct vs Iterative Methods
⭐ CSJMU PYQs: 2024–25, 2021, 2018 (Direct vs Iterative methods, Matrix notation & Ill-conditioned systems)
🎯 Learning Objectives:
  • Formulate linear systems in matrix notation $AX = B$ and augmented matrix $[A | B]$.
  • Contrast Direct Methods (exact in finite operations) with Iterative Methods (successive approximations).
  • Define Ill-Conditioned Systems and understand how small perturbations destabilize solutions.
💡 Conceptual Intuition: Why Do We Need Two Entirely Different Families of Methods?
• Direct Methods (like Gaussian Elimination) are like a cake recipe with a fixed number of steps: follow the steps exactly, and out comes the analytical solution. However, on large computer systems ($N > 1,000$), each arithmetic step rounds off decimals, and after a billion operations, accumulated round-off errors completely corrupt the final answer!
• Iterative Methods (like Gauss-Seidel) are like tuning a radio: you start from an arbitrary guess $(0, 0, 0)$ and refine the numbers repeatedly until the static disappears. Because each iteration recalculates values from the original equations, round-off errors do not accumulate, making iterative methods the gold standard for massive, sparse matrices in engineering!
Evaluation Parameter Direct Methods (Gauss Elimination, Gauss-Jordan, LU) Iterative Methods (Gauss-Seidel, Gauss-Jacobi)
Mathematical Principle Transforms the augmented matrix into a simpler form (triangular or identity) in a fixed, finite number of steps. Generates an infinite sequence of successively improving approximation vectors $\{X^{(k)}\}$ converging toward the true root.
Round-off Error Propagation Accumulates monotonically; for large systems, small errors compound and can destroy numerical validity. Self-correcting; each iteration uses original equations, so round-off errors from previous steps are naturally suppressed.
Stopping Condition Terminates automatically upon completing back substitution. Terminates when maximum absolute difference between consecutive iterations falls below tolerance $\epsilon$: $\max_i |x_i^{(k+1)} - x_i^{(k)}| < \epsilon$.
Computational Efficiency Best for dense, small-to-medium matrices ($N < 100$). Operations scale as $O(N^3)$. Ideal for large, sparse matrices ($N > 10,000$) where most matrix coefficients are zero.
Convergence Requirement Always yields a solution provided $\det(A) \ne 0$. Requires coefficient matrix to satisfy Strict Diagonal Dominance to guarantee convergence.
⚠️ What is an Ill-Conditioned System? (Frequently asked 2-mark question):
A linear system $AX = B$ is called Ill-Conditioned if a tiny, negligible perturbation in the coefficients $A$ or constants $B$ produces an extraordinarily large, catastrophic shift in the solution vector $X$. Geometrically, this happens when the lines or planes represented by the equations are nearly parallel ($\det(A) \approx 0$).
2. Gauss Elimination with Partial Pivoting
⭐ CSJMU PYQs: 2024–25, 2021, 2018 (Forward elimination, partial pivoting rationale, and 10-mark solved system)
⚡ Essential Pass Content

Gaussian Elimination operates in Two Distinct Phases:

  1. Phase 1: Forward Elimination: Successively eliminates unknowns from lower equations using elementary row operations, reducing the augmented matrix $[A | B]$ into an Upper Triangular Matrix where all entries below the main diagonal are zero ($a_{ij} = 0$ for $i > j$).
  2. Phase 2: Back Substitution: Computes the unknown variables in reverse order, starting from the bottom equation: $$x_n = \frac{b_n'}{a_{nn}'}, \quad x_i = \frac{b_i' - \sum_{j=i+1}^n a_{ij}' x_j}{a_{ii}'} \quad \text{for } i = n-1, n-2, \dots, 1$$
⚠️ Why is Partial Pivoting Mathematically Essential?
During forward elimination in column $k$, the multiplier used to eliminate row $i$ is: $$m_{ik} = \frac{a_{ik}}{a_{kk}}$$ Here, $a_{kk}$ is called the Pivot Element.
• If $a_{kk} = 0$, division by zero occurs and the algorithm crashes immediately!
• If $|a_{kk}| \approx 0$ (a tiny decimal like $0.0001$), dividing by it yields massive multipliers ($m_{ik} \approx 10,000$), amplifying small round-off errors and causing numerical instability.
The Partial Pivoting Rule: At step $k$, search column $k$ from row $k$ down to row $n$ for the element with the largest absolute value: $\max_{k \le i \le n} |a_{ik}|$. Interchange row $k$ with that maximum row before eliminating!
📝 Master Solved University Numerical (Gauss Elimination with Pivoting):
Solve the linear system by Gauss Elimination with Partial Pivoting: $$\begin{aligned} 2x + y + z &= 10 \\ 3x + 2y + 3z &= 18 \\ x + 4y + 9z &= 16 \end{aligned}$$

Step-by-Step Augmented Matrix Elimination:

Step 1: Augmented Matrix $[A | B]$ & Initial Pivoting:
In column 1, compare pivot candidates: $|2|, |3|, |1|$. The largest is $|3|$ in Row 2.
Interchange $R_1 \leftrightarrow R_2$: $$\begin{bmatrix} 3 & 2 & 3 & | & 18 \\ 2 & 1 & 1 & | & 10 \\ 1 & 4 & 9 & | & 16 \end{bmatrix}$$
Step 2: Eliminate $x$ from Row 2 and Row 3:
Multipliers: $m_{21} = \frac{2}{3}, \quad m_{31} = \frac{1}{3}$
• $R_2 \leftarrow R_2 - \frac{2}{3} R_1$: $$[2 - 2, 1 - \frac{4}{3}, 1 - 2 \mid 10 - 12] \implies [0, -\frac{1}{3}, -1 \mid -2]$$ • $R_3 \leftarrow R_3 - \frac{1}{3} R_1$: $$[1 - 1, 4 - \frac{2}{3}, 9 - 1 \mid 16 - 6] \implies [0, \frac{10}{3}, 8 \mid 10]$$ Matrix becomes: $$\begin{bmatrix} 3 & 2 & 3 & | & 18 \\ 0 & -1/3 & -1 & | & -2 \\ 0 & 10/3 & 8 & | & 10 \end{bmatrix}$$
Step 3: Pivot Check for Column 2 & Eliminate $y$:
In column 2 below diagonal, compare $|-\frac{1}{3}| \approx 0.333$ with $|\frac{10}{3}| \approx 3.333$.
$|\frac{10}{3}| > |-\frac{1}{3}|$, so interchange $R_2 \leftrightarrow R_3$: $$\begin{bmatrix} 3 & 2 & 3 & | & 18 \\ 0 & 10/3 & 8 & | & 10 \\ 0 & -1/3 & -1 & | & -2 \end{bmatrix}$$ Now eliminate $y$ from Row 3 using multiplier $m_{32} = \frac{-1/3}{10/3} = -\frac{1}{10}$:
$R_3 \leftarrow R_3 - (-\frac{1}{10}) R_2 = R_3 + \frac{1}{10} R_2$: $$[0, -\frac{1}{3} + \frac{1}{3}, -1 + \frac{8}{10} \mid -2 + \frac{10}{10}] \implies [0, 0, -0.2 \mid -1]$$ Upper Triangular Matrix $[U | B']$: $$\begin{bmatrix} 3 & 2 & 3 & | & 18 \\ 0 & 10/3 & 8 & | & 10 \\ 0 & 0 & -0.2 & | & -1 \end{bmatrix}$$
Step 4: Back Substitution:
• From Row 3: $-0.2 z = -1 \implies z = \frac{-1}{-0.2} = \mathbf{5}$
• From Row 2: $\frac{10}{3} y + 8(5) = 10 \implies \frac{10}{3} y + 40 = 10 \implies \frac{10}{3} y = -30 \implies y = -30 \times \frac{3}{10} = \mathbf{-9}$
• From Row 1: $3x + 2(-9) + 3(5) = 18 \implies 3x - 18 + 15 = 18 \implies 3x - 3 = 18 \implies 3x = 21 \implies \mathbf{x = 7}$
Verification in original Equation 1: $2(7) + (-9) + 5 = 14 - 9 + 5 = 10$ ✓. Exact integers obtained!
3. Gauss-Jordan Method & LU Decomposition
⭐ CSJMU PYQs: 2025–26, 2022, 2019 (Explain LU Decomposition / Crout's Method & Gauss-Jordan)

Beyond standard Gaussian Elimination, two other direct methods frequently appear in university examinations:

Method Core Mathematical Procedure Key Distinction & Exam Value
Gauss-Jordan Method Eliminates entries both below AND above the main diagonal, reducing the augmented matrix $[A | B]$ directly into reduced row echelon form $[I | X]$. Zero Back Substitution Required: The right-hand column directly reveals the solution vector $X$. However, it requires $\approx \frac{n^3}{2}$ operations ($50\%$ more than Gauss Elimination).
LU Decomposition (Crout / Doolittle) Factors the coefficient matrix $A$ into the product of a Lower triangular matrix $L$ and an Upper triangular matrix $U$: $A = L \cdot U$. Solves $AX = B$ in Two Swift Steps:
1. Solve $LY = B$ using Forward Substitution.
2. Solve $UX = Y$ using Back Substitution.
Massive advantage: If matrix $A$ is fixed but vector $B$ changes frequently, $A$ is factored only once!
LU Decomposition Matrix Structures (for $3 \times 3$ System): $$L = \begin{bmatrix} l_{11} & 0 & 0 \\ l_{21} & l_{22} & 0 \\ l_{31} & l_{32} & l_{33} \end{bmatrix}, \quad U = \begin{bmatrix} u_{11} & u_{12} & u_{13} \\ 0 & u_{22} & u_{23} \\ 0 & 0 & u_{33} \end{bmatrix}$$ • Doolittle's Method: Diagonal elements of $L$ are set to 1 ($l_{11} = l_{22} = l_{33} = 1$).
• Crout's Method: Diagonal elements of $U$ are set to 1 ($u_{11} = u_{22} = u_{33} = 1$).
4. Gauss-Seidel vs Gauss-Jacobi Iteration Method
⭐ CSJMU PYQs: 2025–26, 2023–24, 2020, 2017 (Strict diagonal dominance condition & iterative numerical — 15 Marks!)
⚡ Essential Pass Content
Strict Diagonal Dominance Condition (Criterion for Guaranteed Convergence):
A system of linear equations is strictly diagonally dominant if in every row $i$, the absolute value of the diagonal coefficient is strictly greater than the sum of the absolute values of all other coefficients in that row: $$|a_{ii}| > \sum_{j \ne i} |a_{ij}| \quad \text{for all } i = 1, 2, \dots, n$$ Row Rearrangement Protocol: If an exam problem is not diagonally dominant as written, you MUST interchange equations so that the largest coefficient in row 1 is on $x$, row 2 on $y$, and row 3 on $z$ before computing any iterations!
Evaluation Parameter Gauss-Jacobi Iteration Gauss-Seidel Iteration
Use of Fresh Values All calculations at iteration $(k+1)$ strictly use values from the previous iteration $k$:
$x_i^{(k+1)} = \frac{1}{a_{ii}}\left(b_i - \sum_{j \ne i} a_{ij} x_j^{(k)}\right)$
As soon as an updated variable $x_i^{(k+1)}$ is calculated, it is immediately used in the subsequent equations of the same iteration!
Convergence Speed Slower convergence rate. Converges approximately twice as fast as the Jacobi method for diagonally dominant systems.
Memory Requirements Requires two full vectors in memory ($X^{(k)}$ and $X^{(k+1)}$). Requires only one vector in memory; newly calculated values overwrite old values in-place.
📝 Solved University Numerical (2025–26 & 2023–24 Exam):
Solve the linear system by Gauss-Seidel Method (perform 3 iterations): $$\begin{aligned} 27x + 6y - z &= 85 \\ 6x + 15y + 2z &= 72 \\ x + y + 54z &= 110 \end{aligned}$$

Step-by-Step Iteration Table:

1. Check Diagonal Dominance:
• Row 1: $|27| = 27 > |6| + |-1| = 7$ (Dominant ✓)
• Row 2: $|15| = 15 > |6| + |2| = 8$ (Dominant ✓)
• Row 3: $|54| = 54 > |1| + |1| = 2$ (Dominant ✓)
The system is strictly diagonally dominant; convergence to the unique solution is mathematically guaranteed.
2. Express Each Variable in Iterative Form:
$$x^{(k+1)} = \frac{1}{27} \Big( 85 - 6y^{(k)} + z^{(k)} \Big)$$ $$y^{(k+1)} = \frac{1}{15} \Big( 72 - 6x^{(k+1)} - 2z^{(k)} \Big)$$ $$z^{(k+1)} = \frac{1}{54} \Big( 110 - x^{(k+1)} - y^{(k+1)} \Big)$$
3. Start with $y^{(0)} = 0, z^{(0)} = 0$:
Iteration $x = \frac{85 - 6y + z}{27}$ $y = \frac{72 - 6x - 2z}{15}$ $z = \frac{110 - x - y}{54}$
Iter 1 $\frac{85 - 0 + 0}{27} = \mathbf{3.1481}$ $\frac{72 - 6(3.1481) - 0}{15} = \mathbf{3.5407}$ $\frac{110 - 3.1481 - 3.5407}{54} = \mathbf{1.9132}$
Iter 2 $\frac{85 - 6(3.5407) + 1.9132}{27} = \mathbf{2.4322}$ $\frac{72 - 6(2.4322) - 2(1.9132)}{15} = \mathbf{3.5720}$ $\frac{110 - 2.4322 - 3.5720}{54} = \mathbf{1.9258}$
Iter 3 $\frac{85 - 6(3.5720) + 1.9258}{27} = \mathbf{2.4257}$ $\frac{72 - 6(2.4257) - 2(1.9258)}{15} = \mathbf{3.5729}$ $\frac{110 - 2.4257 - 3.5729}{54} = \mathbf{1.9260}$

After 3 iterations, values stabilize at: $x \approx 2.426, y \approx 3.573, z \approx 1.926$.

5. Exam Answer Blueprint & Pitfalls to Avoid
How to Score Full 10 Marks on "Gauss Elimination with Pivoting":
  1. Augmented Matrix Notation (2 Marks): Write the initial $[A | B]$ matrix clearly. State why partial pivoting is applied before doing row operations.
  2. Row Operations (4 Marks): Show each elementary row operation explicitly: $R_i \leftarrow R_i - m_{ik} R_k$. Don't skip intermediate matrix forms!
  3. Back Substitution (3 Marks): Write each substitution step backwards from $z$ to $y$ to $x$.
  4. Verification (1 Mark): Substitute the calculated $(x, y, z)$ into one of the original equations to prove correctness to the examiner.
⚠️ Common Exam Pitfalls:
• Applying Gauss-Seidel without testing Diagonal Dominance: If you start calculating iterations on a system where $|a_{ii}| \le \sum |a_{ij}|$ without swapping rows, the numbers will oscillate to infinity ($\pm \infty$) and you get zero marks!
• Using old values in Gauss-Seidel: Remember: the moment $x^{(k+1)}$ is computed, substitute THAT NEW VALUE into the equation for $y^{(k+1)}$. Do not use $x^{(k)}$! Using old values is the Jacobi method, not Gauss-Seidel!
📝 Unit IV Exam Mastery MCQ Quiz (10 Questions)

Answer all 10 questions to test your understanding of direct vs iterative methods, pivoting, and Gauss-Seidel convergence.