4.5.26 · D5Linear Algebra (Full)

Question bank — LU decomposition — algorithm, applications

2,186 words10 min readBack to topic

This bank supports LU decomposition — algorithm, applications and links to Gaussian Elimination, Permutation Matrices, Determinants, Matrix Inverse, Cholesky Decomposition, and Triangular Systems & Substitution. Everything you need is defined right here — you should not have to leave this page.


A picture-first refresher (read before the traps)

Figure — LU decomposition — algorithm, applications
Figure — LU decomposition — algorithm, applications
Figure — LU decomposition — algorithm, applications

True or false — justify

Remember the setup: means is unit lower triangular (1's on its diagonal, zeros above it) and is upper triangular (zeros below its diagonal). Judge each claim, then reveal.

The diagonal entries of can be any nonzero numbers
False — in the standard (Doolittle) LU the diagonal of is forced to be all 1's; those 1's are what make the factorisation unique for a given .
always has the pivots of Gaussian elimination on its diagonal
True — clearing each column leaves the pivot untouched on the diagonal, so is the -th pivot.
Every square matrix has an factorisation without any row swaps
False — if a pivot position hits a zero (e.g. ), plain breaks; you need with a permutation .
If is invertible then (no permutation) is guaranteed
False — invertibility is not enough; you also need every leading principal submatrix (each top-left block) to be nonsingular. is invertible but its block is , so it has no plain LU.
equals the product of the diagonal entries of times those of
True but trivial — (product of 1's), so , the product of pivots.
Swapping two rows during pivoting never changes the value of
False — each row swap multiplies the determinant by , so .
The product of a lower- and an upper-triangular matrix is always triangular
False — that product is generally a full matrix (that's the whole point: rebuilds the dense ). Only or stay triangular.
For a symmetric positive-definite matrix, and carry no shared information
False — for SPD matrices for a diagonal , which is exactly the Cholesky factorisation up to scaling; is essentially transposed.
An LU factorisation of a given (once you fix "1's on 's diagonal") is unique
True — with the diagonal of pinned to 1's and all pivots nonzero, and are uniquely determined.
Only square matrices can be LU-factorised
False — rectangular factors too, with a trapezoidal or ; this is why least-squares problems can lean on LU (or Cholesky of ).

Spot the error

Each line states a plausible-sounding move. Find the flaw.

"To solve , first back-solve , then forward-solve ."
Backwards — is lower triangular so it needs forward substitution; is upper triangular so it needs back substitution. The names are tied to which corner is known first.
"I have , so to solve I invert and and compute ."
Correct in symbols but self-defeating on two fronts — forming inverses costs (destroying the speed win), and an explicit inverse spreads and amplifies round-off: multiplying by magnifies input error by the condition number of , whereas triangular substitution keeps that growth far smaller. Never invert; substitute.
"The multiplier is ."
Wrong index — you divide by the pivot (the diagonal entry of the column being cleared), not : .
" stores because elimination subtracts times a row."
Wrong sign — the elimination matrix holds , but is its inverse, which flips the sign back to . stores the multipliers with a plus.
"When a pivot is exactly zero I should just add a tiny to it and carry on."
Dangerous — dividing by a near-zero pivot makes some multiplier enormous, and that huge factor injects magnified round-off into every later entry. The correct fix is partial pivoting (a row swap recorded in ), which is exact and free.
"Because , a zero pivot means I picked the wrong algorithm."
No — a zero pivot mid-elimination for a singular is honest information: . The algorithm is right; the matrix simply has no inverse.
"Partial pivoting changes the answer , so avoid it when possible."
False — permuting rows of and together yields the same solution ; only the numerical rounding path changes, and for the better.
"After factoring once, solving with a new requires re-running Gaussian elimination."
That defeats LU's purpose — the elimination (the work) is already baked into . A new needs only the two substitutions.

Why questions

Why do we keep and instead of just storing the row-reduced ?
alone loses the record of how you got there; holds the multipliers, letting you re-apply the elimination to any new via without redoing the reduction.
Why does eliminating "top-down, left-to-right" let us just write the multipliers into with no extra work?
Because each later elimination step touches columns to the right of, or rows below, the earlier ones — the inverse elementary matrices don't overlap, so their product just deposits each into slot .
Why is the diagonal of all 1's rather than the pivots?
Each elimination step leaves the pivot row unscaled (we subtract multiples of it, never rescale it), so the corresponding elementary matrices — and their product — keep 1's on the diagonal. The pivots live in instead.
Why is LU decomposition preferred over computing explicitly for solving systems?
Forming is more arithmetic and numerically worse — multiplying by an explicit inverse amplifies error by the condition number of , while triangular solves stay tighter. LU gives the solve cheaply and more accurately.
Why does partial pivoting choose the largest candidate entry as the new pivot?
Dividing by the largest available entry forces every multiplier ; small multipliers can't blow up existing round-off, so accumulated error (and the effective conditioning of the solve) stays controlled — it's about stability, not correctness.
Why can we read straight off the pivots?
Triangular determinants are just diagonal products, and ; elimination is engineered so the pivots equal that product (adjusted by per swap).
Why does having many right-hand sides make LU so much cheaper than repeated Gaussian elimination?
The expensive factorisation () happens once; each extra is two substitutions at each, so solves cost instead of .
Why do least-squares problems reach for LU or Cholesky even though is rectangular?
You don't factor the tall to solve directly; you form the square symmetric positive-definite and LU- (or Cholesky-) factor that to solve the normal equations .

Edge cases

Every diagonal of is nonzero — does that guarantee no permutation is needed?
No — a pivot can become zero mid-elimination even when the original diagonal is fine, because later entries are updated. Only the running pivots matter.
What is the LU factorisation of a matrix that is already upper triangular?
(no elimination needed, all multipliers are 0) and . The identity is the degenerate unit-lower-triangular matrix.
What are and when is already lower triangular (not diagonal)?
Elimination above the diagonal does nothing (those entries are already 0), so comes out diagonal, holding 's diagonal entries, and equals with each column divided by its diagonal pivot (so 's diagonal becomes 1's). Concretely with and . Only when is diagonal do these collapse to .
Can a singular matrix ever have a valid ?
Yes — a zero can appear as a late pivot () while earlier pivots are fine, giving a legitimate with . It just can't be used to solve for a unique .
What happens to the two substitutions if has a zero on its diagonal?
Back-substitution hits a division by that zero pivot — signalling is singular, so either no solution or infinitely many exist.
For the matrix with , what are and ?
and — the unit-diagonal convention forces 's single entry to 1, so the lone pivot sits in .
For a tall matrix, what shapes are and ?
is unit-lower-trapezoidal (1's on its two diagonal spots) and is upper triangular — the general rectangular case with .
If is symmetric but not positive-definite, can we still use Cholesky instead of LU?
Not safely — Cholesky () needs positive pivots (it square-roots them); without positive-definiteness a pivot can be negative or zero and the square root fails, so you fall back to LU with pivoting.
If has a whole zero column, what does elimination reveal?
The pivot in that column is 0 and cannot be fixed by any row swap (the entire column is zero), so is singular — no unique solve exists, matching .

Recall One-line takeaways

is lower ⇒ forward-solve. is upper ⇒ back-solve. stores with 1's on its diagonal, stores the pivots. A zero pivot means permute (if fixable) or singular (if not). Rectangular still factors — trapezoidal or — powering least-squares via .