ArticleslgStudy

mathematics

LU decomposition

LU decomposition is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand LU decomposition rather than just read about it. In short: In numerical analysis and linear algebra, lower–upper (LU) decomposition or factorization factors a matrix as the product of a lower triangular matrix and an upper triangular matrix (see matrix multiplication and matrix decomposition). The product sometimes includes a permutation matrix as well.

LU decomposition — main illustration
LU decomposition — illustration

Key takeaways

  • LU decomposition belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect LU decomposition to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of LU decomposition from memory before moving on to harder problems.

Reference excerpt

In numerical analysis and linear algebra, lower–upper (LU) decomposition or factorization factors a matrix as the product of a lower triangular matrix and an upper triangular matrix (see matrix multiplication and matrix decomposition). The product sometimes includes a permutation matrix as well. LU decomposition can be viewed as the matrix form of Gaussian elimination. Computers usually solve square systems of linear equations using LU decomposition, and it is also a key step when inverting a matrix or computing the determinant of a matrix. It is also sometimes referred to as LR decomposition (factors into left and right triangular matrices). The LU decomposition algorithm for general matrices was introduced by the Polish astronomer Tadeusz Banachiewicz in 1938.

Definitions

Let A be a square matrix. An LU factorization refers to expression of A into product of two factors – a lower triangular matrix L and an upper triangular matrix U such that A = LU. Sometimes factorization is impossible without prior reordering of A to prevent division by zero or uncontrolled growth of rounding errors. Hence alternative expression becomes PAQ = LU, where in formal notation permutation matrix factors P and Q indicate permutation of rows (or columns) of A. In theory P (or Q) is obtained by permutations of rows (or columns) of the identity matrix; in practice the corresponding permutations are applied directly to rows (or columns) of A. Matrix A of size n has n2 coefficients while two triangle matrices combined contain n(n + 1) coefficients, and therefore n coefficients of matrices LU are not independent. The convention is to set L unitriangular, i.e. with all n main diagonal elements equal to one. However, setting instead U matrix unitriangular reduces to the same procedure after transpose of matrix product (cf. properties of matrix transposition): B=A𝖳=(LU)𝖳=U𝖳L𝖳. After transposition, UT is lower triangle while LT is upper unitriangular factor of B. This demonstrates also, that operations on rows (e.g. pivoting) are equivalent to those on columns of a transposed matrix, and in general choice of row or column algorithm offers no advantage. In the lower triangular matrix all elements above the main diagonal are zero, in the upper triangular matrix, all the elements below the diagonal are zero. For example, for a 3 × 3 matrix A, its LU decomposition looks like this: [a11a12a13a21a22a23a31a32a33]=[ℓ1100ℓ21ℓ220ℓ31ℓ32ℓ33][u11u12u130u22u2300u33]. Without a proper ordering or permutations in the matrix, the factorization may fail to materialize. For example, it is easy to verify (by expanding the matrix multiplication) that a11=ℓ11u11. If a11=0, then at least one of ℓ11 and u11 has to be zero, which implies that either L or U is singular. This is impossible if A is nonsingular (invertible). In terms of operations, zeroing/elimination of remaining elements of first column of A involves division of a21,a31 with a11, impossible if it is 0. This is a procedural problem. It can be removed by simply reordering the rows of A so that the first element of the permuted matrix is nonzero. The same problem in subsequent factorization steps can be removed the same way. For numerical stability against rounding errors/division by small numbers it is important to select a11 of large absolute value (cf. pivoting).

LU through recursion The above example of 3 × 3 matrices demonstrates that matrix product of top row and leftmost columns of involved matrices plays special role for LU to succeed. Let us mark consecutive versions of matrices with (0),(1),… and then let us write matrix product A≡A(0)=L(0)U(0) in such way that these rows and columns are separated from the rest. In doing so we shall use block matrix notation, such that e.g. a≡a11 is an ordinary number, 𝐰𝖳≡(a12,a13)𝖳 is a row vector and 𝐯=(a21,a31) is a column vector and A′ is sub-matrix of matrix A(0) without top row and leftmost column. Then we can replace A(0)=L(0)U(0) with a block matrix product. Namely it turns out that one can multiply matrix blocks in such way as if they were ordinary numbers, i.e. row times column, except that now their components are sub-matrices, sometimes reduced to scalars or vectors. Thus u𝐥 denotes a vector obtained from 𝐥 after multiplication of each component by a number u, 𝐥𝐮𝖳 is an outer product of vectors 𝐥,𝐮, i.e. a matrix which first column is u12𝐥, next is u13𝐥 and so on for all components of 𝐮 and L(1)U(1) is a product of sub-matrices of L(0),U(0) (a𝐰𝖳𝐯A′)=(1𝟎𝖳𝐥L(1))(u𝐮𝖳𝟎U(1))=(u𝐮𝖳u𝐥𝐥𝐮𝖳+L(1)U(1)) From equality of first and last matrices follow final u=a, 𝐮=𝐰, 𝐥=(1/a)𝐯 while matrix A′ becomes updated/replaced with A(1)≡L(1)U(1)= A′−𝐥𝐮𝖳. Now comes the crucial observation: nothing prevents us to treat A(1) the same way as we did with A(0), repeatedly. If dimension of A is n × n, after n− 1 such steps all columns 𝐯 form sub-diagonal part of triangle matrix L and all pivots a combined with rows 𝐰𝖳 form upper triangle matrix U, as required. In the above example n = 3 so only two steps suffice. The above procedure demonstrates that at no step the top diagonal pivot element a of consecutive sub-matrices can be zero. To avoid it columns or rows may be swapped so that a becomes nonzero. Such procedure involving permutation is called LUP, decomposition with pivoting. Permutation of columns corresponds to matrix product AQ(0) where Q(0) is a permutation matrix, i.e. the identity matrix I after the same column permutation. After all steps such LUP decomposition applies to AQ(0)⋯Q(n−1)≡AQ=LU. Present computation scheme and similar in Cormen et al. are examples of recurrence algorithms. They demonstrate two general properties of LU factorization:

Recurrence algorithms are not overly costly in terms of algebraic operations yet they suffer from practical disadvantage due to need to update and store most elements of A at each step. It will be seen that by reordering calculations it is possible to dispose with storage of intermediate values.

… excerpt ends here. Continue reading the full article.

Illustrations

LU decomposition: Illustration of operation of Banachiewicz LU algorithm to obtain 3-rd row and column of respectively matrices U and L. Involved matrices are named above squares marking their content. Matrix products and subtractions are applied only to elements in the thick frame boxes. Green filled thin frame boxes indicate values already known, from previous stages. Blue boxes indicate places in U and L matrices for storing of results.
Illustration of operation of Banachiewicz LU algorithm to obtain 3-rd row and column of respectively matrices U and L. Involved matrices are named above squares marking their content. Matrix products and subtractions are applied only to elements in the thick frame boxes. Green filled thin frame boxes indicate values already known, from previous stages. Blue boxes indicate places in U and L matrices for storing of results.
LU decomposition: LU decomposition: LU factors and their product in original Banachiewicz (1938) matrix notation
LU decomposition: LU factors and their product in original Banachiewicz (1938) matrix notation

Worked examples

Example 1 — a first encounter with LU decomposition

Start with the simplest possible case. Write down what LU decomposition claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to LU decomposition before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about LU decomposition ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of LU decomposition

In research
LU decomposition appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses LU decomposition in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
LU decomposition is common in secondary-school and first-year university syllabi. It links to neighbouring topics Matrix decompositions, Numerical linear algebra, so understanding it makes those chapters shorter.
In everyday life
Look for LU decomposition outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “LU decomposition” →

How to study LU decomposition in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what LU decomposition means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain LU decomposition out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is LU decomposition in simple terms?

In numerical analysis and linear algebra, lower–upper (LU) decomposition or factorization factors a matrix as the product of a lower triangular matrix and an upper triangular matrix (see matrix multiplication and matrix decomposition). The product sometimes includes a permutation matrix as well.

Why does LU decomposition matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study LU decomposition?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on LU decomposition.

Tags

  • Matrix decompositions
  • Numerical linear algebra

Keep exploring