M03 — Linear systems and conditioning
Almost every solver in this repository ends in : each Newton step of M02 is one, and so is every least-squares fit. Elimination is the oldest algorithm in the subject, and the interesting part is not how it works but how much of the answer survives it. This notebook separates the two owners of the error: the algorithm, which pivoting and orthogonal factorisations keep honest, and the problem, whose condition number no algorithm can change.
Book pages: Linear system and One matrix, two errors in
books/numerical-methods.
The question. A solver hands back and reports a residual at the level of rounding. How many digits of can you trust, and who decides?
By the end you can:
- write Gaussian elimination as and say why it costs multiply-adds
- show a tiny pivot destroying an answer, and say what partial pivoting bounds
- derive and read as digits lost
- separate backward error (the algorithm's) from forward error (the problem's too)
- explain why the normal equations square and QR does not
- read rank from singular values, and say how otkd uses it to pick its solver
Assumes: M01 (relative error, machine epsilon, conditioning), M02 (Newton's linear solve), and matrix norms.
How to use it: predict before you reveal, commit before you check, and move the controls until the equation's behaviour stops surprising you.
Warm-up: remember (closed book)
1. Gaussian elimination is LU
Setting: the problem, its sets and its symbols
Problem. Given a nonsingular whose pivots are all nonzero (no row swaps) and , find a unit lower-triangular and an upper-triangular with , then with by solving and ; count the multiply-adds as a function of .
| Symbol | In | Meaning |
|---|---|---|
| the number of unknowns, set by the slider | ||
| the matrix, nonsingular; the example is | ||
| the right-hand side (data) and the solution (unknown); the example has | ||
| unit lower-triangular: ones on the diagonal, the multipliers below it | ||
| upper-triangular: the rows left after elimination; is the -th pivot | ||
| the multiplier that clears entry at step , for : that entry over the pivot | ||
| the elimination step: column is cleared below the diagonal | ||
| the intermediate vector of the forward sweep, |
How these symbols connect
The data are a nonsingular matrix and right-hand side ; the unknown is satisfying . Elimination at steps clears below-diagonal entries using multipliers to factorise into a unit lower-triangular and an upper-triangular . That factorisation turns the linear solve into two triangular sweeps: forward substitution solves for the intermediate vector , and back substitution solves for . All quantities in the example are dimensionless; when units are present, is dimensionless, shares the units of , and shares those of .
Symbol-by-symbol notes
$L$ and $U$ — triangular factors
is unit lower-triangular: every diagonal entry is , every entry above the diagonal is , and the subdiagonal entry holds the multiplier . is upper-triangular, with zeros below the diagonal and the pivots on it; the no-swap assumption here requires every .
$\ell_{ik}$ — elimination multiplier
Defined only for at step : it is the current entry in row , column divided by the pivot of that step. Do not confuse with the original matrix entry , because earlier steps have already updated row .
$y$ — intermediate vector, not a coordinate
In the two-step solve then , is the right-hand side after forward elimination. In the scalar equations written below, the two components of are also called and , which is distinct from this vector .
$A$ nonsingular and zero-free pivots
Nonsingularity guarantees a unique solution , but without row swaps is a stronger requirement: every leading principal submatrix must be nonsingular so no pivot vanishes. Section 2 removes that restriction with row permutations.
Take the book's system , . Subtract of row 1 from row 2: the second row becomes . Keep the multiplier and the reduced rows, and you have
Elimination step is left-multiplication by a unit lower-triangular matrix holding the multipliers ; its inverse flips their signs, and the product of the inverses is . So elimination is the factorisation , and solving is two triangular sweeps: forward, then backward. Here
Cost. Step updates the trailing block, one multiply-add per entry, so the total is
multiply-adds ( flops). Each triangular solve is about . The factorisation is the expensive part, and once it exists every further right-hand side is cheap.
| multiply-adds in elimination | ratio | ||
|---|---|---|---|
| 50 | 40,425 | 41,667 | 0.970 |
Reveal result (lock in your prediction above first)
At your : 40,425 multiply-adds; at : 328,350, a factor of 8.12.
The two lines merge: the lower-order terms vanish by . This is the bill M02's Newton method pays every step with a dense Jacobian: one factorisation of , then two triangular solves for . np.linalg.solve is LAPACK's gesv, LU with partial pivoting; scipy.linalg.lu_factor and lu_solve split the two parts so a factor can be reused.
When LU factorisation breaks
- Assumes: every pivot met on the way is non-zero, which holds for a non-singular matrix once rows may be swapped
- When it fails: a zero pivot stops elimination without row swaps even when is invertible (try ), and a dense factor of a large sparse matrix fills in and runs out of memory
- Check: the factor reports its pivots;
scipy.linalg.lu_factorwarns on an exactly zero one
2. Partial pivoting
Setting: the problem, its sets and its symbols
Problem. Given , the matrix and below, find with in double precision, by elimination without a row swap and by elimination with partial pivoting (); compare each computed with .
| Symbol | In | Meaning |
|---|---|---|
| the (1, 1) entry, the first pivot without a swap; the slider sets | ||
| , nonsingular for | ||
| the data, | ||
| the exact solution and the computed one | ||
| a permutation matrix: the row swaps partial pivoting chooses | ||
| the triangular factors, as in §1; is the second pivot | ||
| the second entry of the forward sweep's | ||
| , with the largest absolute row sum | ||
| the growth factor | ||
| machine epsilon for doubles, |
How these symbols connect
Choosing via the slider fixes the dimensionless matrix , which together with defines the exact solution of . Elimination without swaps and elimination with partial pivoting (, where records row swaps) each produce triangular factors , a forward-sweep entry , and a floating-point solution computed in double precision (spacing scale ). Comparing against alongside and the growth factor separates how sensitive the linear system is from how much intermediate numbers grow during factorisation.
Symbol-by-symbol notes
$P$ — permutation matrix
A matrix in with exactly one in each row and column, formed by reordering the rows of the identity matrix. Multiplying on the left () reorders the equations before elimination, so the same permutation must be applied to the right-hand side (); .
$\kappa_\infty(A)$ — infinity-norm condition number
Defined as , where the matrix -norm is the maximum absolute row sum . It is a property of alone, independent of whether rows are swapped, and is dimensionless.
$\rho$ — growth factor
The dimensionless ratio comparing the largest entry created in with the largest entry of . Unlike , it depends on the pivoting strategy and measures element amplification inside elimination.
$\delta$ vs $\epsilon$ — two small parameters
is the configurable entry of , whereas is the fixed double-precision unit spacing at . The slider lets cross so you can compare behaviour on both sides of floating-point precision.
Solve
The matrix is as well conditioned as matrices get: for every small . Eliminate without swapping rows. The multiplier is , so
Once exceeds , both and round to : the second row's own entries have been swamped. Before that point, is M01's cancellation (two numbers near 1) divided by a tiny , the same shape as the difference quotient's round-off floor.
Partial pivoting swaps rows so the pivot is the largest entry in its column. Here the multiplier becomes , , and nothing is swamped. Every multiplier is at most 1 in size, which keeps the growth factor small, and the error bound of elimination is a modest multiple of .
| method | relative error | growth | |||
|---|---|---|---|---|---|
| 4.000 | no swap | (1.0001000100, 0.9998999900) | 2.81e-13 | 1.0e+04 | |
| partial pivoting | (1.0001000100, 0.9998999900) | 2.22e-16 | 1.0e+00 |
Reveal result (lock in your prediction above first)
Without the swap the error grows like and reaches 100 per cent once ; with it, the error stays at rounding level (points on the floor are exact). The matrix never changed its condition number. This is the one failure in this notebook that a better algorithm removes.
When partial pivoting breaks
- Assumes: the growth factor stays modest
- When it fails: it can reach (Wilkinson's example: 1 on the diagonal and in the last column, below the diagonal), though it is rare in practice
- Check: compute from
scipy.linalg.lu; a large one says the backward error may be large too
3. The condition number: a small residual is not a small error
Setting: the problem, its sets and its symbols
Problem. Given a nonsingular , data and a computed , bound the relative error of against by a quantity computable from ; then measure both on the Hilbert matrices .
| Symbol | In | Meaning |
|---|---|---|
| the order, set by the slider | ||
| the matrix, nonsingular | ||
| the data and the exact solution , not computable | ||
| the solution the solver returned | ||
| the residual , computable | ||
| a vector norm, and on matrices the norm it induces, ; the table uses the 2-norm | ||
| the condition number ; in the 2-norm | ||
| the largest and smallest singular values of | ||
| the Hilbert matrix, for ; symmetric positive definite | ||
| the vector of ones; the test takes , rounded to doubles | ||
| machine epsilon for doubles, |
How these symbols connect
Given a nonsingular matrix and nonzero data , a solver returns in place of the unknown exact solution . From alone you can compute the residual , and an induced matrix norm together with links the computable relative residual to the uncomputable relative error . The experiment evaluates both ratios on the dimensionless Hilbert family with as the order varies from to .
Symbol-by-symbol notes
$r$ vs $x - \hat x$ — residual against error
The residual lives in the data space (same units as ) and can always be computed once is known. The error lives in the solution space (same units as ) and cannot be computed without knowing ; they are linked by .
$\lVert \cdot \rVert$ — vector norm and induced matrix norm
The same notation denotes a norm on and its operator norm on , ensuring submultiplicativity . In the 2-norm, and .
$\kappa(A)$ and $\sigma\lt em>{\max}, \sigma\lt /em>{\min}$ — condition number
is dimensionless and depends on the chosen norm, with in the 2-norm. Because is nonsingular, , so is finite, though it can be arbitrarily large.
$H_n$ and $\mathbf 1$ — the Hilbert test family
uses 1-based indices , giving a symmetric positive definite matrix whose entries are exact rationals that mostly round when stored as doubles. Taking in doubles means the exact solution of the stored floating-point system already differs slightly from .
Let solve and let be what came back. The residual is computable; the error is not, since it needs . Subtract from :
Multiply the two:
This is M01's grown up: the worst-case amplification of a relative perturbation, owned by the problem. In the 2-norm , and with rounding-level data the relative error is about : you lose about of the 16 digits.
The Hilbert matrix is the classic ill-conditioned family.
Take , solve with np.linalg.solve, and measure against the exact
solution of the stored system, computed in rational arithmetic, so both the
residual and the error below are free of rounding.
| relative error | bound | rounding alone moved by | |||
|---|---|---|---|---|---|
| 8 | 1.53e+10 | 1.57e-16 | 2.12e-09 | 2.39e-06 | 7.0e-08 |
The last column compares the exact solution of the stored system with , the solution before and were rounded to doubles. That loss happened before the solver ran: M01's "the loss belongs to the question".
Reveal result (lock in your prediction above first)
At : relative residual 1.1e-16, relative error 7.8e-03, bound 1.8e+00. The residual is flat at rounding level for every ; the error climbs with and stays under the bound. Both are measured in exact arithmetic, so nothing here is a rounded zero. We stop at 12, where has passed : beyond it of the stored matrix is no longer the of the Hilbert matrix.
When the error bound breaks
- Assumes: you know in the norm you measure the error in
- When it fails: needs ; beyond it is no longer well defined in doubles: for the Hilbert matrix of order 13 the exact is , the copy rounded to doubles has , and numpy reports
- Check:
np.linalg.cond, or a LAPACK estimate from the factors; treat near 1 as no digits
4. Backward stability
Setting: the problem, its sets and its symbols
Problem. Given a nonsingular , and a computed , find the smallest relative perturbation of the data for which is an exact solution, and relate it to the forward error ; compare an LU solve with on .
| Symbol | In | Meaning |
|---|---|---|
| the order, set by the slider | ||
| the data, as in §3 | ||
| the exact solution and the computed one | ||
| the residual | ||
| perturbations of the data with | ||
| a relative size: and | ||
| the backward error: the least such | ||
| , the 2-norm in the table | ||
| rounding to the nearest double; is the set of doubles | ||
| the relative rounding error of one operation, | ||
| the Hilbert matrix of §3, with | ||
| machine epsilon for doubles, ; not the above |
How these symbols connect
Given the linear system and a nonzero computed solution , backward error analysis asks for perturbations so that holds exactly. Measuring their relative size by yields the backward error as the smallest admissible , computed directly from the residual and norms of , , and . Combining the algorithm-owned with the problem-owned bounds the forward error , which the experiment compares for solve and inv(A) @ b on the dimensionless family .
Symbol-by-symbol notes
$\varepsilon$ vs $\epsilon$ — perturbation bound against machine epsilon
is a dummy variable ranging over candidate relative perturbation sizes such that and . is the fixed double-precision machine epsilon; an algorithm is backward stable when stays a modest multiple of .
$\eta(\hat x)$ — backward error
Defined as the minimum feasible over all making an exact solution; it is dimensionless and requires (and for relative scaling). Do not confuse with the relative residual , which only perturbs and omits the term in the denominator.
$\Delta A$ and $\Delta b$ — data perturbations
carries the units of and carries the units of , so the ratios and are dimensionless. They are a thought-experiment device: they need not be the actual rounding errors made during execution.
$\mathrm{fl}$ and $\delta$ — floating-point rounding model
rounds a real number to its nearest IEEE 754 double in , satisfying with (away from overflow and underflow). This is a per-operation rounding error, not the pivot of §2.
§3 split the error into two factors. The algorithm owns , the problem owns . Make the algorithm's share precise: the backward error of is the smallest relative change to the data that solves exactly. For perturbations of both and it has a closed form (Rigal and Gaches):
An algorithm is backward stable if is a modest multiple of for every input. You met the idea in M01 without the name: a correctly rounded is the exact sum of and . Then perturbation theory finishes the job: when ,
Forward error condition number backward error. LU with partial pivoting is backward stable in practice ( small). Multiplying by a computed inverse is not, even though itself is computed well. Move and compare.
| backward error | forward error | |||
|---|---|---|---|---|
np.linalg.solve(H, b) |
6.9e-17 | 5.8e-05 | 1.1e-03 | 3.6e-03 |
np.linalg.inv(H) @ b |
1.6e-05 | 2.4e-03 | 2.5e+08 |
. Where the bound says nothing; the inverse's forward error can still sit near , which is why the defect goes unnoticed. Backward stability is the stronger promise: the answer is the exact answer to data you could have been given.
When backward stability breaks
- Assumes: the answer is judged by the data it exactly solves, and that data was itself only known to about
- When it fails: a backward-stable answer to an ill-conditioned problem can still be wrong in every digit; stability bounds the algorithm's share, not the problem's
- Check: compute ; near means the solver did its job
5. Least squares: normal equations against QR
Setting: the problem, its sets and its symbols
Problem. Given with and full column rank, and , find , once through the normal equations and once through ; compare each computed with .
| Symbol | In | Meaning |
|---|---|---|
| the number of data points, | ||
| the polynomial degree, set by the slider | ||
| the sample points, equally spaced, | ||
| the Vandermonde matrix , ; full column rank | ||
| the data, , so the fit is exact | ||
| the coefficients, the minimiser () and a computed one | ||
| the Gram matrix of the normal equations, symmetric positive definite | ||
| orthonormal columns, | ||
| upper-triangular and nonsingular | ||
| orthonormal columns: the left factor of the thin SVD | ||
| with ; orthogonal | ||
| the 2-norm condition number of a matrix of full column rank | ||
| the angle between and the range of ; here | ||
| machine epsilon for doubles, |
How these symbols connect
Sampling points and choosing a degree builds the tall Vandermonde matrix of full column rank, which maps polynomial coefficients to fitted values . With data , the exact minimiser of is (angle ). Two factorisations produce computed coefficients : forming the square Gram matrix for the normal equations, or factorising directly; the thin SVD defines for comparing their conditioning in double precision (). All quantities are dimensionless.
Symbol-by-symbol notes
$A$ — Vandermonde matrix of degree $d$
Has shape because a degree- polynomial has coefficients, indexed with . Because the nodes are distinct and , has full column rank .
$Q$ and $R$ — thin QR factors
is rectangular with orthonormal columns, so (whereas is the orthogonal projector onto the column space of , not ). is square, upper-triangular, and nonsingular whenever has full column rank.
$U$, $\Sigma$, $V$ — thin SVD of a tall matrix
Like , has orthonormal columns (), while and are square with . Do not confuse this with the upper-triangular factor of LU in §§1–2.
$\kappa(\cdot)$ for a rectangular matrix
For a tall matrix of full column rank, does not exist, so is defined via the singular values as . For a square SPD matrix such as , this agrees with .
$\theta$ — residual angle
The angle in between and its projection onto the column space of , satisfying (when ). Setting makes so the experiment isolates zero-residual behaviour.
Fit a polynomial of degree to 50 points in : the matrix is , more rules than unknowns, so solve . To isolate the algorithms, take : the fit is exact and the right coefficients are all ones.
Normal equations. The gradient of is ; set it to zero: , a square SPD system for Cholesky. With , , so its singular values are and
Forming has already thrown away what a error throws away, however good the solver after it.
QR. Write with orthonormal columns in . An orthogonal map keeps lengths, so minimising reduces to , and . Householder QR is backward stable, so the error is about . The price is about twice the flops of the normal equations when the matrix is tall.
| normal equations error | QR error | ||||
|---|---|---|---|---|---|
| 6 | 2.0e+04 | 3.9e+08 | 3.9e+08 | 2.7e-09 | 6.1e-14 |
Reveal result (lock in your prediction above first)
At degree 11 the normal equations miss by 1.1e-01 and QR by 7.5e-09. Each method tracks its dashed line: QR follows , the normal equations . With a non-zero fit residual even QR picks up a term, where is the angle between and the range of ; the normal equations pay whatever is. An error of exactly 0 is drawn at , so the log axis can show it.
When QR least squares breaks
- Assumes: has full column rank and the fit residual is small
- When it fails: with rank deficiency has a near-zero diagonal and the coefficients are arbitrary in the null direction; with a large residual even QR's sensitivity carries a term
- Check: look at or the singular values; switch to the SVD when the smallest is near
6. The SVD shows rank
Setting: the problem, its sets and its symbols
Problem. Given and a tolerance , find the numerical rank, the number of singular values , and the left singular vectors of the discarded , which name the dependent rows; apply it to the constraint Jacobian , with and without a copied row.
| Symbol | In | Meaning |
|---|---|---|
| rows (rules) and columns (unknowns); here and | ||
| a general matrix, and the example , with appended as row 4 when the box is ticked | ||
| how far row 3 is from the sum of rows 1 and 2; the slider sets | ||
| orthogonal matrices of left and right singular vectors, | ||
| zero except | ||
| the singular values, | ||
| for ; infinite when | ||
| the relative threshold; otkd uses | ||
| the number of singular values above the threshold | ||
| a left singular vector for a discarded : , and its nonzero entries are the rows in the dependence |
How these symbols connect
Given any matrix — here the constraint Jacobian with unknowns and rows controlled by and the duplicate-row toggle — the full SVD separates orthogonal row and column bases , from the ordered singular values in . Comparing each against the relative cutoff yields the numerical , while measures conditioning when . Any discarded singular value comes with a left singular vector (a column of ) whose nonzero components identify the dependent rows; all entries in the example are dimensionless.
Symbol-by-symbol notes
$U \in O(m)$ and $V \in O(n)$ — full SVD orthogonal factors
is the group of square orthogonal matrices (), and likewise . Unlike the thin SVD of §5, the full SVD keeps all columns of even when , because the extra columns span the left null space where redundant-row dependencies live.
$\Sigma$ and $\sigma_i$ — rectangular diagonal matrix and singular values
has the same shape as , holding on its main diagonal and zeros elsewhere. Zero singular values are allowed here (unlike §5's full-rank case), signalling exact rank deficiency.
$\kappa_2 \in [1, \infty]$ — extended condition number
Defined as for , with the convention when (and ). It differs from the truncated ratio computed after discarding singular values below .
$\mathrm{rtol}$ and $\operatorname{rank}$ — numerical rank
Exact algebraic rank jumps discontinuously at , whereas floating-point rounding turns exact zeros into tiny nonzero numbers. Numerical rank counts using a dimensionless relative threshold (otkd sets ), so scaling by any nonzero constant leaves the rank unchanged.
$w$ — left singular vector for a discarded $\sigma_i$
A unit column of paired with a singular value , or with one of the extra zero rows of when . Since , the linear combination is near zero, so the nonzero entries of pinpoint the rows involved in the dependence.
Every matrix factors as with orthogonal and on the diagonal of . Two facts make it the diagnostic of last resort. , so §3's condition number is a ratio of singular values. And is the 2-norm distance from to the nearest singular matrix: is how far, in relative terms, the problem is from having no unique answer.
So rank in floating point is a decision with a tolerance: count the . otkd uses on the Jacobian of a mechanism's constraint rows. Take three rules in three unknowns, the third nearly the sum of the first two:
For it is invertible in exact arithmetic. Move , and add a duplicated rule, and watch the verdict otkd would reach.
Reveal result (lock in your prediction above first)
| singular values | rank | rows | verdict | solver | rows in the dependence | condition as diagnose reports it |
|
|---|---|---|---|---|---|---|---|
| 1.73e+00, 1.00e+00, 5.77e-05 | 3 | 3 | square | Newton, an LU solve per step (§1–2) | none | 3.00e+04 | 3.00e+04 |
diagnose reports the condition of the part it keeps, :
when the rank drops, that number falls back to order 1, because the near-dependence
has been moved out of the conditioning and into the rank. The left singular vectors
for the discarded name the rows in the dependence: with the copied row and
visible, rows 1 and 4.
This is the bridge to the S track. System.classify counts the rank of the constraint Jacobian at the design pose with exactly this rule and picks the solver: rank below the number of unknowns is under-determined; rank equal to the number of rows is square and goes to Newton, whose step is np.linalg.solve with a lstsq fallback; more rows than rank is redundant and goes to least squares. diagnose is the same SVD, kept to name the redundant rows.
source: `open_textbook.otkd.solvers.system.System.classify` — `solvers/otkd/src/open_textbook/otkd/solvers/system.py:78`
def classify(self) -> str:
"""`square`, `redundant`, `under`, or `equilibrium`."""
if self.springs:
return "equilibrium"
rank, _, _ = rank_and_null(self.jacobian(self.problem.q0()), rtol=1e-10)
n = self.problem.n
if rank < n:
return "under"
return "square" if len(self.constrained) == rank else "redundant"
source: `open_textbook.otkd.solvers.svd.diagnose` — `solvers/otkd/src/open_textbook/otkd/solvers/svd.py:23`
def diagnose(system: System, q: np.ndarray, *, rows: list[int] | None = None, rtol: float = 1e-10) -> Diagnosis:
"""Rank, left null space and participating row names at `q`.
`rtol` governs both decisions: singular values at or below `rtol * s[0]` are
treated as zero when computing `rank`, and rows whose largest left-null
coefficient exceeds `rtol` are named in `dependent_rows`.
"""
rows = system.constrained if rows is None else rows
jac = system.jacobian(q, rows)
rank, null, s = left_null(jac, rtol=rtol)
names = [system.problem.rows[i].name for i in rows]
if null.shape[1]:
weight = np.max(np.abs(null), axis=1)
dependent = tuple(name for name, w in zip(names, weight) if w > rtol)
else:
dependent = ()
condition = float(s[0] / s[rank - 1]) if rank else float("inf")
return Diagnosis(
singular_values=s,
rank=rank,
redundancy=len(rows) - rank,
dependent_rows=dependent,
null_space=null,
condition=condition,
)
When a rank decision breaks
- Assumes: a gap in the singular values separates the zero ones from the rest
- When it fails: with no gap the rank depends on
rtol, and a change of tolerance changes otkd's verdict between square, redundant and under-determined - Check: print the singular values beside the threshold and look for several orders of magnitude of daylight
Practice
Hint 1
What is in terms of ?
Hint 2
The error of a backward-stable solve is about for the system it actually solves, with .
Mixed practice. Choose the method, with M01 and M02 in the mix.
Check yourself (closed book)
Keep these:
- Elimination is : multiply-adds once, then per right-hand side.
- Pivot: a small pivot is the algorithm's failure, and row swaps remove it.
- Forward error backward error; is the number of digits the problem takes.
- A small residual certifies the solver, not the answer. Solve; do not invert.
- Normal equations square ; QR keeps it; the SVD shows rank, which is how otkd chooses between Newton and least squares.
Your connection
Name a linear solve you rely on (a fit, a calibration, a Newton step). Do you know its condition number? Which of its digits would you defend?
Answers
Practice A. .
Practice B. about , from .
Practice C. multiply-adds.
Mixed practice. LU with partial pivoting; QR (or SVD); rewrite the formula; SVD rank and the dependent rows.
Where the maths is derived
Optional. These notes give the intuition and application; the sources below give the full derivations and proofs.
§1 Gaussian elimination is LU
- Trefethen and Bau (1997), Numerical Linear Algebra: elimination as and its flop count, in the lectures on systems of equations.
§2 Partial pivoting
- Higham (2002), Accuracy and Stability of Numerical Algorithms: the backward error of LU in terms of the growth factor, and the cases where pivoting's growth is large.
§3 Condition number and the error bound
- Trefethen and Bau (1997), Numerical Linear Algebra: condition numbers of problems and of matrices, and the bound (Lecture 12).
§4 Backward stability
- Higham (2002), Accuracy and Stability of Numerical Algorithms: forward and backward error, the normwise backward error of a computed solution (Rigal and Gaches), and why inverting is not backward stable for .
§5 Least squares: normal equations against QR
- Trefethen and Bau (1997), Numerical Linear Algebra: least squares by normal equations, QR and SVD, and the conditioning and stability of each.
§6 The SVD shows rank
- Trefethen and Bau (1997), Numerical Linear Algebra: the SVD, rank as the number of non-zero singular values, and as the distance to the nearest rank-deficient matrix.
Compiled from notebooks/methods/m03_linear_systems.py — run locally with cd notebooks && uv run marimo edit methods/m03_linear_systems.py for live Python scratch cells.
Back to the book: Linear system · One matrix, two errors