Conditioning & Banded Systems
Understanding accuracy limits, the condition number, and optimizing for special matrix structures.
🎯 Lecture Goals
- 1 Accuracy: How do we know if GE results are good? (Condition Number).
- 2 Efficiency: Can we beat $\mathcal{O}(n^3)$ for special systems? (Tridiagonal, Banded).
Key Insight
A small residual ($r = b - Ax$) does NOT always mean a small error ($e = x_{true} - x_{calc}$).
The Condition Number is the bridge.
Geometric Singularity
Visualizing linear systems as intersecting lines helps understand ill-conditioning.
Robust System
Lines intersect cleanly at a large angle.
-0.5x + y = 1
rank(A) = 2
Ill-Conditioned
Lines are nearly parallel. Tiny changes in lines move intersection hugely.
(2+δ)x + y = 6+δ
Numerically indistinguishable from singular.
Condition Number $\kappa(A)$
The sensitivity of the solution $x$ to perturbations in $b$ or $A$ is bound by the condition number.
Range: $[1, \infty)$
Perturbation Theory
If we perturb $b$ by $\delta b$, how much does $x$ change?
$\kappa(A)$ acts as an error amplifier.
Digits of Precision
How many trustworthy digits $d$ do we have?
Example: $\epsm \approx 10^{-16}$. If $\kappa(A) = 10^{10}$, you have only $\approx 6$ correct digits!
Computational Stability
Backward Stability
"[Backward stable algorithms] give exactly the right answer to nearly the right question." — Trefethen & Bau
Gaussian Elimination with Partial Pivoting is backward stable. It solves $(A+E)\hat{x} = b$ where $E$ is small.
The Residual Trap
We can calculate the residual $r = b - A\hat{x}$. It simply checks if the equation balances.
WARNING: If $\kappa(A)$ is large, a tiny residual can still mean a massive error in $x$.
MATLAB's Backslash Operator
In MATLAB or Python (NumPy), we rarely type these algorithms manually. We use smart "poly-algorithms".
What happens under the hood?
Special Systems: Tridiagonal
Many physics and engineering problems connect only neighbors (e.g., springs, heat flow). This creates sparse, banded matrices.
Storage Advantage
Full matrix: $n^2$ doubles.
Tridiagonal: $3n-2$ doubles.
Huge savings for
large $n$.
Speed Advantage
Standard GE: $\mathcal{O}(n^3)$
Tridiagonal GE: $\mathcal{O}(n)$ (Linear time!)
Thomas Algorithm (Tridiagonal Solver)
🧠 Final Challenge +20 XP
You solve $Ax=b$ and get a tiny residual $r \approx 10^{-16}$. However, $\kappa(A) \approx 10^{14}$. Is your solution accurate?