4.8.19 · D1Numerical Methods

Foundations — LU decomposition (numerical)

1,603 words7 min readBack to topic

This page assumes you know nothing. We will earn every symbol — , , , "triangular", , , , , — before the parent note is allowed to use it.


1. What is a "linear system"? ()

Suppose two mystery numbers, call them and , obey two rules:

Each rule is linear: the unknowns appear only multiplied by fixed numbers and added — no squares, no products of unknowns. Finding the pair that satisfies both is solving a linear system.

Writing the multipliers, unknowns and answers separately gives three objects.

For our example:

The whole system compresses to the single line .

Figure — LU decomposition (numerical)

What the picture shows: row of paired with reproduces the left side of equation ; the red column holds the answers. So is exactly the two equations, just tidied up.

Row-then-column ordering matters — say it aloud as "row , column " every time.


2. Multiplying a matrix by a vector — the "row dot" picture

Before we can factor we must know what means as an operation.

Row 1 of our gives — the left side of equation 1. That is the whole reason the matrix form is faithful.

Matrix-times-matrix (, coming up) is the same move repeated: entry of the product is row of the first matrix dotted with column of the second.

Figure — LU decomposition (numerical)

What the picture shows: the red row slides across the black column; each aligned pair is multiplied and the products summed to a single output slot. Master this one motion and every LU formula becomes readable.


3. What does "triangular" mean, and why do we crave it?

Figure — LU decomposition (numerical)

What the picture shows: black cells = numbers that may be nonzero, white cells = forced zeros. fills the lower wedge, the upper wedge; where they overlap (the diagonal) both carry numbers.

Why we crave triangular systems. Look at an upper-triangular system: The last equation has only one unknown: instantly. Feed it upward and the next equation also has one unknown. No grinding — just read off, one variable at a time. That process is called back substitution (bottom-up for ) and its twin forward substitution (top-down for ). See Forward and Back Substitution.

So if we could rewrite the hard matrix as two triangular matrices, solving would become effortless. That wish is precisely LU decomposition.


4. The elimination move (where is born)

To make a triangle we use the one legal move of Gaussian Elimination:

Example: row 2 is , row 1 is . To zero the leading we need , giving new row 2 . The system is now triangular.

That is why the parent note can say " are the Gaussian-elimination multipliers." Now the phrase carries a picture: a table of the 's.


5. When the move fails: the zero pivot and

If that pivot is , the division explodes. But an all-zero column is not required — sometimes we just picked the rows in an unlucky order. The cure is to swap rows so a nonzero (ideally the largest) number sits on the pivot. See Partial Pivoting.

With swaps the honest statement becomes : first reorder, then factor. Choosing the biggest pivot also keeps every , which stops rounding errors from ballooning — the accuracy concern of Condition Number and Numerical Stability.


6. Two free gifts these symbols hand us

  • Determinant. A triangular matrix's determinant is just the product of its diagonal. Since Doolittle's has all-1 diagonal (), .
  • Reuse. Because and depend only on (not on ), a new right-hand side costs only two triangular solves. Factor once, solve many.

Prerequisite map

Linear system A x = b

Matrix times vector

Row operation and multiplier m

Gaussian Elimination makes a staircase

Triangular shape lower and upper

Forward and Back Substitution

Save multipliers as L keep staircase as U

Zero pivot problem

Partial Pivoting and Permutation P

LU Decomposition A = LU or P A = LU

Bonus determinant and fast re-solves


Equipment checklist

Cover the right side and test yourself. If any answer is fuzzy, reread that section before the parent note.

What does stand for in plain words?
A tidy shorthand for a whole set of linear equations: coefficients , unknowns , answers .
What does the index point to?
The number in row , column of (row first, column second).
How do you compute entry of ?
Dot row of with the column : multiply aligned pairs and sum.
What is a lower-triangular matrix?
All entries above the main diagonal are zero; numbers fill the lower wedge.
Why are triangular systems easy?
One equation has a single unknown; solve it, substitute, repeat — no elimination grind.
What is the multiplier in a row operation?
The number chosen so that (rowrow) zeroes a target entry.
Where do the entries of come from?
They are those saved multipliers; is a diary of the elimination.
What is a pivot and when does it fail?
The diagonal entry we divide by; it fails when it is (division blows up).
What does a permutation matrix do?
Shuffles rows; it records the swaps so we factor and can undo them.
How do you get once you have ?
Multiply 's diagonal entries and flip sign once per row swap.

Connections