Skip to content

Gaussian Elimination⚓︎

Lower–Upper (LU) decomposition or factorization factors a matrix as the product of a lower triangular matrix and an upper triangular matrix. The product sometimes includes a permutation matrix as well. LU decomposition can be viewed as the matrix form of Gaussian Elimination.

Introduction to LU Factorization⚓︎

General steps of Gaussian Elimination:

[××××××××××××××××]L1[××××0×××0×××0×××]
L2[××××0×××00××00××]L3[××××0×××00××000×];
L3L2L1A=U

Question: What is Li ?

In essence:

xk=[x1kxkkxk+1,kxmk]Lk[x1kxkk00]

Define ljkxjkxkk. Then we can do the (j)ljk(k) row reduction. Also define:

Lk[11lk+1,klm,k1]

And:

Lk[x1kxkkxk+1,kxmk][x1kxkk00];
Lk=IlkekT;lk=[00lk+1,klmk],ek=[001(k+1 position)00]

Then:

Lk=IlkekT,
Lm1L2L1A=UA=L11L21Lm11U

Note that the inverse of a lower triangular matrix is also a lower triangular matrix. The product of lower triangular matrices is also a lower triangular matrix.

Define LL11L21Lm11. Then:

A=LU

is the LU factorization.

Here are some useful conclusions:

Lk1=I+lkekT
Lk1Lk=(I+lkekT)(IlkekT)=IlkekTlkekT=I

Also note:

Lk1Lk+11=(I+lkekT)(I+lk+1ek+1T)
=I+lkekT+lk+1ek+1T+lkekTlk+1ek+1T
=I+lkekT+lk+1ek+1T
=[11lk+1,k1lk+2,k+1lm,klm,k+11]

This is good for bookkeeping the solutions. Therefore:

L=L11L21Lm11=[1l211lk+1,klm1lm,k1];
A=LU

To solve Ax=b, we may solve LUx=b instead. Define y=Ux. We can solve two linear systems:

Ly=b,Ux=y

Steps of Gaussian Elimination⚓︎

Algorithm ( Simple Gaussian Elimination (GE) ):

( Given A, we output L,U. )

Let U=A,L=I first;

For k=1,2,,m1:

  • For j=k+1,k+2,,m:
    • lj,k=uj,kuk,k;
    • uj,k:m=uj,k:mlj,kuk,k:m;
  • End;

End

There are actually three loops for this algorithm.

Question: What is the cost of the algorithm?

We measure the computational complexity by the number of flops (floating point operations):

k=1m1j=k+1m2(mk+1)+123m3+O(m2)

Therefore, the cost of LU factorization is O(m3).

Forward and Backward Substitution⚓︎

Consider Ly=b, we do Forward Substitution:

For j=1,2,,m:

yj=bjk=1j1lkjyk

End. The cost for it is O(m2).

Consider Ux=y, we do Backward Substitution:

For j=m,m1,,1:

xj=1rjj(yjk=j+1mxkrjk)

Evaluation⚓︎

Gaussian-Elimination (Native) is not stable!

e.g., Matrix A=[0111] fails at the first step.

e.g., For matrix

A=[1020111]

Apply GE, we get:

L=[1010201],U=[10201011020]

However, in computer representation, the actual matrix might be like:

L~=[1010201],U~=[1020101020]

Then:

L~U~=[1020110]A

A small mistake can lead to a large perturbation.

Solution to this problem is partial pivoting.