4.8.19 · D5Numerical Methods

Question bank — LU decomposition (numerical)

1,666 words8 min readBack to topic

Reminder of the vocabulary you need (all built in the parent note): means we split a square matrix into a lower-triangular (only zeros above the diagonal) times an upper-triangular (only zeros below the diagonal). In the Doolittle convention carries 's on its diagonal. The entries of below the diagonal are written ==== (row , column , with ) — these are the elimination multipliers, i.e. how much of an upper row we subtracted to zero out entry . The pivots are the diagonal entries of . Partial pivoting (Partial Pivoting) reorders rows via a permutation matrix (Permutation Matrices) to give .

Figure — LU decomposition (numerical)

The next picture shows the real engine behind the Doolittle ordering — why solving row of , then column of , repeat never leaves you with two unknowns at once. Follow the orange highlight: each new equation touches exactly one entry you don't yet know.

Figure — LU decomposition (numerical)

True or false — justify

Is always possible for any invertible square , with no row swaps?
False — a leading principal submatrix (a top-left square block) can be singular, which forces a zero pivot and breaks the factorization even though itself is invertible; (with swaps) always exists.
In Doolittle form, is the LU factorization of a matrix unique when it exists?
True — fixing 's diagonal to all 's removes the one scaling freedom between and , so the entries are forced and unique.
True or false: if is symmetric, then automatically in the Doolittle factorization.
False — Doolittle forces 's on 's diagonal, so in general; the symmetric analogue is Cholesky Decomposition , which needs symmetric positive-definite.
Is it true that in every LU decomposition?
Only in the Doolittle convention — the 's on 's diagonal make its product-of-diagonal determinant equal ; in Crout Decomposition the 's sit on instead, so there .
True or false: a lower-triangular times an upper-triangular matrix is always triangular.
False — the product generally fills every entry; that is exactly why (a full matrix) can equal .
Is it true that partial pivoting can change which matrix you factor but never changes the final solution ?
True — swapping rows of and the matching entries of is just reordering equations, which never alters the solution set; it only reorders the arithmetic for stability.
True or false: computing and forming gives the same accuracy as an LU-solve.
False — explicit inversion does more arithmetic and amplifies rounding more, so LU-solve is both faster and more accurate (see Condition Number and Numerical Stability).
Is the number of row swaps used in an LU with pivoting uniquely determined?
No — different valid pivoting choices can swap differently, but the parity (even vs odd) of swaps is fixed because it must match the sign of via Determinants.

Spot the error

"Since and are both triangular, I'll put the 's on AND on to be safe." — what's wrong?
You cannot fix both diagonals: that over-constrains the system and destroys the factorization. You choose exactly one convention (Doolittle: 's in ; Crout: 's in ).
"I solved but plugged the original straight into ." — the bug?
The row swaps stored in must be applied to the right-hand side too; you must solve , otherwise the equations no longer match their reordered rows.
", so I set and got a huge number — the matrix must be singular." — is the diagnosis right?
Not necessarily — a zero pivot can occur in a perfectly invertible matrix (like ); the cure is a row swap, not declaring singular. (Here is the multiplier that would zero the entry — dividing it by the zero pivot is what exploded.)
"To get I multiplied the diagonal of and stopped there." — what did you forget?
The sign from pivoting: . If any rows were swapped, omitting gives the wrong sign.
"I did back substitution on starting from the bottom row." — why does this fail?
is lower-triangular, so its first row has a single unknown; you must go top-to-bottom (forward substitution). Bottom-first is for the upper-triangular .
"The multipliers I discard during Gaussian elimination are irrelevant to LU." — correct?
Wrong — those discarded multipliers are the entries of (row , column ); LU's whole trick is keeping them instead of throwing them away.
"Partial pivoting picks the largest entry in the whole remaining matrix as the pivot." — accurate?
No — partial pivoting searches only the current column (below the diagonal) for the largest magnitude; searching the whole submatrix is complete pivoting, a different, costlier scheme.

Why questions

Why does having triangular factors make solving so cheap?
A triangular system reveals one unknown per row in order, so each equation is solved by a single division after back-substituting knowns — no elimination sweep is needed.
Why do we choose the largest available pivot rather than just any nonzero one?
A large pivot keeps every multiplier , which prevents small rounding errors from being multiplied into large ones during elimination.
Why does LU pay off only when we resolve with many right-hand sides?
The expensive elimination is done once to build and ; each new then costs only two cheap triangular substitutions, so the setup cost is amortised across solves.
Why is the determinant of a triangular matrix just the product of its diagonal?
Expanding by the column (or row) that has a single nonzero entry each time leaves only the diagonal factors multiplied together, with all off-diagonal cofactors zero.
Why does the row-by-, column-by- ordering in Doolittle work so smoothly?
Picture matching one entry at a time (see the second figure): each new entry equation is a sum of already-known products plus one brand-new unknown, because everything "earlier" in the row/column snake has already been solved. So instead of a tangled simultaneous system you get a clean chain, solving one variable per equation — exactly like knocking over dominoes in order.
Why can a nearly-zero pivot be almost as bad as an exactly-zero one?
Dividing by a tiny pivot produces enormous multipliers that amplify floating-point rounding, so accuracy collapses even though no literal division-by-zero occurs.
Why is (with a permutation) enough to guarantee a factorization for every invertible ?
Because for any invertible there is always a row ordering that keeps every leading pivot nonzero, and records exactly that reordering.

Edge cases

What is the LU decomposition of the identity matrix ?
: it is already both lower- and upper-triangular with unit diagonal, so no elimination is needed and .
What happens when you LU-factor a matrix that is already upper-triangular?
and : there is nothing below the diagonal to eliminate, so all multipliers are zero.
If a matrix is , say with , what are and ?
and in Doolittle form; there are no off-diagonal entries, so the factorization is trivial.
What does a zero on the diagonal of tell you about (assuming you have already pivoted as much as possible)?
After all valid row swaps, if a pivot is still forced to zero then , so and is genuinely singular — no swap can rescue it because the rows are linearly dependent. (A zero pivot before pivoting is different: that one a row swap can fix.)
For a diagonal matrix with nonzero entries, what are its LU factors?
and : a diagonal matrix is simultaneously lower- and upper-triangular, so all off-diagonal multipliers vanish.
What is the smallest change to that makes Doolittle work without any swap, and what does the factorization become?
Replace the zero by any nonzero value , giving ; then , , , so it factors — but as the multiplier blows up, showing that "just non-zero" fixes the breakdown yet a tiny still wrecks numerical accuracy (why we prefer a swap).

Recall One-line summary to lock it in

LU is Gaussian elimination saved as data: holds the multipliers , holds the pivots , (when needed) holds the swaps — and every "trap" above is either a convention slip (whose diagonal gets the 's), a bookkeeping slip (permute too), or a stability slip (avoid tiny pivots).