Euler Hall — free maths guides

Check that LU equals A

Check a factorisation by multiplying and comparing every entry with A. The idea in plain words, a worked example, and a check with the answers shown — part of the free Linear Algebra guides.

Every entry, and the shape first

A=LUA=LU is an entry-by-entry statement: for every(i,j)(i,j),(LU)ij=aij(LU)_{ij}=a_{ij}. Checking it means multiplying and comparing, not inspecting.

Two steps, in this order.

1. Shape.LL must ben×nn\times n lower triangular with ones on its diagonal;UU must ben×nn\times n upper triangular. If either fails, stop — the pair is not a candidate. 2. Every entry. Multiply out and compare alln2n^2 entries.

Passing step 1 says nothing about step 2. A pair can be perfectly shaped and multiply to a completely different matrix.

What each entry tests. With no row exchange,(LU)i1=ℓi1u11(LU)_{i1}=\ell_{i1}u_{11} tests one multiplier per row; the diagonal tests the pivots; the rest test combinations. A pair that agrees on three of four entries is wrong, not nearly right — there is no partial credit for a factorisation.

Why a matching diagonal is not evidence

The diagonal ofLULU mixes multipliers and pivots:

(LU)22=ℓ21u12+u22.(LU)_{22}=\ell_{21}u_{12}+u_{22}.

Two errors can cancel here — too large anℓ21\ell_{21} with too small au22u_{22} gives the right sum and the wrong factors. And the(1,1)(1,1) entry has no multiplier in it at all, so it cannot detect one.

What makes the check decisive.LL is unit lower triangular, hence invertible. SoLU=ALU=A has exactly one solution forUU givenLL: multiply byL−1L^{-1}. That means

LU=A  ⟺  U=L−1A,LU=A\iff U=L^{-1}A,

so a proposed pair is either exactly right or wrong at some entry. There is no "close". This also gives a second way to check — computeL−1AL^{-1}A and compare withUU — which is worth using when the numbers are awkward.

Worked example: a genuine factorisation, then a near miss

Genuine.L=[1031]L=\begin{bmatrix}1&0\\3&1\end{bmatrix},U=[2104]U=\begin{bmatrix}2&1\\0&4\end{bmatrix},A=[2167]A=\begin{bmatrix}2&1\\6&7\end{bmatrix}.

Near miss. SameLL, butU=[2105]U=\begin{bmatrix}2&1\\0&5\end{bmatrix}:

LU=[2168]≠[2167].LU=\begin{bmatrix}2&1\\6&8\end{bmatrix}\ne\begin{bmatrix}2&1\\6&7\end{bmatrix}.

Three entries agree and the pair is wrong. The disagreement is at(2,2)(2,2), which is where the extra pivot contributes — so the second pivot is the number to look at.

Where the sign shows up. FlipLL's multiplier to−3-3 and(LU)21=−6(LU)_{21}=-6, then(LU)22=−3+4=1(LU)_{22}=-3+4=1: now two entries disagree, and both are in row 2. The row of the product tells you which row ofLL is wrong.

By the end you can
  • Check a factorisation by multiplying and comparing every entry with A
  • Explain why matching shapes and matching diagonals are necessary but not sufficient
  • Say which row of L a disagreement in row i of LU implicates
  • State that a factorisation is exact, so there is no partial credit
Before you move on

<ol class="steps"> <li>IsL=[1031],U=[1200]L=\begin{bmatrix}1&0\\3&1\end{bmatrix},U=\begin{bmatrix}1&2\\0&0\end{bmatrix} a factorisation ofA=[1236]A=\begin{bmatrix}1&2\\3&6\end{bmatrix}?</li> <li>Why is comparing shapes alone never enough?</li> <li>A proposed pair disagrees only at entry(3,1)(3,1). Which number should you recheck?</li> <li>IfLL is not unit lower triangular, canLU=ALU=A have two solutions forUU?</li> </ol>

Answers

1. Yes:LU=[1236]=ALU=\begin{bmatrix}1&2\\3&6\end{bmatrix}=A. 2. Shape is necessary and says nothing about values; a correctly shaped pair multiplies to a different matrix all the time. 3.ℓ31\ell_{31}, because(LU)31(LU)_{31} equalsℓ31\ell_{31} times the first pivot alone. 4. Yes. Without ones on the diagonalLL is not pinned, and(LD)(D−1U)(LD)(D^{-1}U) gives other pairs with the same product.

Work out where to start — free, no accountAnswer six real questions — free, no account