Gauss Elimination Method (\(Ax = b\))

Solve linear systems by transforming the augmented matrix \([A \mid b]\) into upper-triangular form \([U \mid b']\) via elementary row operations, followed by back substitution.

Solution Vector \(x\) & Diagnostics

Step-by-Step Row Operations & Back Substitution

Scilab & Python Code (Minimal Exam-Ready)

Two-Phase Algorithm

  1. Forward Elimination: For pivot row \(i\), eliminate column \(i\) in rows \(j > i\) using multiplier \(m_{ji} = A_{ji}/A_{ii}\): $$ R_j \leftarrow R_j - m_{ji} R_i $$
  2. Back Substitution: Solve from bottom row \(n\) up to row \(1\): $$ x_i = \frac{1}{U_{ii}}\left(b'_i - \sum_{j=i+1}^{n} U_{ij} x_j\right) $$

Partial Pivoting & Complexity

  • Partial pivoting: Swapping the row with the largest \(|A_{ri}|\) into the pivot position avoids division by zero and minimizes round-off amplification.
  • Operation count: Forward elimination requires \(\approx \frac{2}{3}n^3\) flops; back substitution requires \(n^2\) flops.