L⁡U factorization

1.Gaussian elimination and row echelon reduction

Suppose now that A⁢x=b admits a unique solution. How to find it? We are especially interested in constructing a general procedure, that will work no matter what the size of A might be. This means we seek an algorithm that precisely specifies the steps that lead to the solution, and that we can program a computing device to carry out automatically. One such algorithm is Gaussian elimination.

Consider the system

{ x1+2⁢x2-x3 = 2 2⁢x1-x2+x3 = 2 3⁢x1-x2-x3 = 1 .

The idea is to combine equations such that we have one fewer unknown in each equation. Ask: with what number should the first equation be multiplied in order to eliminate x1 from sum of equation 1 and equation 2? This number is called a Gaussian multiplier, and is in this case -2. Repeat the question for eliminating x1 from third equation, with multiplier -3.

{ x1+2⁢x2-x3 = 2 2⁢x1-x2+x3 = 2 3⁢x1-x2-x3 = 1 .⇒{ x1+2⁢x2-x3 = 2 -5⁢x2+3⁢x3 = -2 -7⁢x2+2⁢x3 = -5 .

Now, ask: with what number should the second equation be multiplied to eliminate x2 from sum of second and third equations. The multiplier is in this case -7/5.

{ x1+2⁢x2-x3 = 2 -5⁢x2+3⁢x3 = -2 -7⁢x2+2⁢x3 = -5 .⇒{ x1+2⁢x2-x3 = 2 -5⁢x2+3⁢x3 = -2 -115⁢x3 = -115 .

Starting from the last equation we can now find x3=1, replace in the second to obtain -5⁢x2=-5, hence x2=1, and finally replace in the first equation to obtain x1=1.

The above operations only involve coefficients. A more compact notation is therefore to work with what is known as the "bordered matrix"

( 1 2 -1 2 2 -1 1 2 3 -1 -1 1 )∼( 1 2 -1 2 0 -5 3 -2 0 -7 2 -5 )∼( 1 2 -1 2 0 -5 3 -2 0 0 -115 -115 )

Once the above triangular form has been obtain, the solution is found by back substitution, in which we seek to form the identity matrix in the first 3 columns, and the solution is obtained in the last column.

( 1 2 -1 2 0 -5 3 -2 0 0 -115 -115 )∼( 1 2 -1 2 0 -5 3 -2 0 0 1 1 )∼( 1 0 0 1 0 1 0 1 0 0 1 1 )

2.L⁡U-factorization

2.1.Example for m=3

Consider the system A⁢x=b

{ x1+2⁢x2-x3 = 2 2⁢x1-x2+x3 = 2 3⁢x1-x2-x3 = 1 .

with

A=( 1 2 -1 2 -1 1 3 -1 -1 ),b=( 2 2 1 )

We ask if there is a matrix L1 that could be multiplied with A to produce a result L1⁢A with zeros under the main diagonal in the first column. First, gain insight by considering multiplication by the identity matrix, which leaves A unchanged

( 1 0 0 0 1 0 0 0 1 )( 1 2 -1 2 -1 1 3 -1 -1 )=( 1 2 -1 2 -1 1 3 -1 -1 )

In the first stage of Gaussian multiplication, the first line remains unchanged, so we deduce that L1 should have the same first line as the identity matrix

L1=( 1 0 0 ? ? ? ? ? ? )
( 1 0 0 ? ? ? ? ? ? )( 1 2 -1 2 -1 1 3 -1 -1 )=( 1 2 -1 0 -5 3 0 -7 2 )

Next, recall the way Gaussian multipliers were determined: find number to multiply first line so that added to second, third lines a zero is obtained. This leads to the form

L1=( 1 0 0 ? 1 0 ? 0 1 )

Finally, identify the missing entries with the Gaussian multipliers to determine

L1=( 1 0 0 -2 1 0 -3 0 1 )

Verify by carrying out the matrix multiplication

L1⁢A=( 1 0 0 -2 1 0 -3 0 1 )( 1 2 -1 2 -1 1 3 -1 -1 )=( 1 2 -1 0 -5 3 0 -7 2 )

Repeat the above reasoning to come up with a second matrix L2 that forms a zero under the main diagonal in the second column

L2=( 1 0 0 0 1 0 0 -7/5 1 )
L2⁢L1⁢A=( 1 0 0 0 1 0 0 -7/5 1 )( 1 2 -1 0 -5 3 0 -7 2 )=( 1 2 -1 0 -5 3 0 0 -11/5 )=U

We have obtained a matrix with zero entries under the main diagonal (an upper triangular matrix) by a sequence of matrix multiplications.

2.2.General m case

From the above, we assume that we can form a sequence of multiplier matrices such that the result is an upper triangular matrix U

Lm-1...⁢L2⁢L1⁢A=U

Definition. The matrix

𝑳k=( 1 … 0 … 1 0 ⋱ 0 … 0 0 … 1 … 0 0 … -lk+1,k … 0 0 … -lk+2,k … 0 ⋮ … ⋮ ⋱ ⋮ 0 … -lm,k … 1 )

with li,k=ai,k(k)/ak,k(k), and 𝑨(k)=(ai,j(k)) the matrix obtained after step k of row echelon reduction (or, equivalently, Gaussian elimination) is called a Gaussian multiplier matrix.

We will show that this indeed possible if A⁢x=b admits a unique solution. Furthermore, the product of lower triangular matrices is lower triangular, and the inverse of a lower triangular matrix is lower triangular (same applies for upper triangular matrices). Introduce the notation

L-1=Lm-1...⁢L2⁢L1

and obtain

L-1⁢A=U

or

A=L⁢U

The above result permits a basic insight into Gaussian elimination: the procedure depends on "factoring" the matrix A into two "simpler" matrices L,U. The idea of representing a matrix as a product of simpler matrices is fundamental to linear algebra, and we will come across it repeatedly.

For now, the factorization allows us to devise the following general approach to solving A⁢x=b

  1. Find the factorization L⁢U=A

  2. Insert the factorization into A⁢x=b to obtain (L⁢U)⁢x=L⁢(U⁢x)=L⁢y=b, where the notation y=U⁢x has been introduced. The system

    L⁡y=b

    is easy to solve by forward substitution to find y for given b

  3. Finally find x by backward substitution solution of

    U⁢x=y

Algorithm Gauss elimination without pivoting

for s=1 to m-1

for i=s+1 to m

t=-ai⁡s/as⁡s

for j=s+1 to m

ai⁡j=ai⁡j+⁡t⋅as⁡j

bi=bi+t⋅bs

for s=m downto 1

xs=bs/as⁡s

for i=1 to s-1

bi=bi-ai⁡s⋅xs

return x

Algorithm Gauss elimination with partial pivoting

p=1:m (initialize row permutation vector)

for s=1 to m-1

piv = abs(ap(s),s)

for i=s+1 to m

mag = abs(ap(i),s)

if mag>piv then

piv=mag;⁡k=p(s);⁡p(s)=p(i);⁡p(i)=k

if piv<ϵ then break(“Singular matrix”)

t=-ap(i)⁡s/ap(s)⁡s

for j=s+1 to m

ap(i)⁡j=ap(i)⁡j+⁡t⋅ap(s)⁡j

bp(i)=bp(i)+t⋅bp(s)

for s=m downto 1

xs=bp(s)/ap(s)⁡s

for i=1 to s-1

bp(i)=bp(i)-ap(i)⁡s⋅xs

return x

Given 𝑨∈ℝm×n

Singular value decomposition

Gram-Schmidt

Lower-upper

Transformation of coordinates

𝑨⁡𝒙=𝒃

𝑼⁡𝚺⁡𝑽T=𝑨

𝑸⁡𝑹=𝑨

𝑳⁡𝑼=𝑨

(𝑼⁡𝚺⁡𝑽T)𝒙=𝒃⇒𝑼⁡𝒚=𝒃⇒𝒚=𝑼T𝒃

(𝑸⁡𝑹)𝒙=𝒃⇒𝑸⁡𝒚=𝒃, 𝒚=𝑸T𝒃

(𝑳⁡𝑼)𝒙=𝒃⇒⁡𝑳⁡𝒚=𝒃⁡(forward⁡sub⁡to⁡find⁡)y

𝚺⁡𝒛=𝒚⇒𝒛=𝚺+𝒚

𝑹⁡𝒙=𝒚⁡(back⁡sub⁡to⁡find⁡.⁡𝒙)

𝑼⁡𝒙=𝒚 (back sub to find 𝒙)

𝑽T𝒙=𝒛⇒𝒙=𝑽⁡𝒛

3.Inverse matrix

By analogy to the simple scalar equation a⁢x=b with solution x=a-1⁢b when a≠0, we are interested in writing the solution to a linear system A⁢x=b as x=A-1⁢b for A∈ℝm×m, x∈ℝm. Recall that solving A⁢x=b=I⁢b corresponds to expressing the vector b as a linear combination of the columns of A. This can only be done if the columns of A form a basis for ℝm, in which case we say that A is non-singular.

Definition 1. For matrix A∈ℝm×m non-singular the inverse matrix is denoted by A-1 and satisfies the properties

A⁡A-1=A-1⁢A=I

3.1.Gauss-Jordan algorithm

Computation of the inverse A-1 can be carried out by repeated use of Gauss elimination. Denote the inverse by B=A-1 for a moment and consider the inverse matrix property A⁢B=I. Introducing the column notation for B,I leads to

A( B1 ... Bm )=( e1 ... em )

and identification of each column in the equality states

A⁡Bk=ek,k=1,2,..,m

with ek the column unit vector with zero components everywhere except for a 1 in row k. To find the inverse we need to simultaneously solve the m linear systems given above.

Gauss-Jordan algorithm example. Consider

A=( 1 2 3 -1 3 1 2 -1 -2 )

To find the inverse we solve the systems A⁢B1=e1,A⁢B2=e2,A⁢B3=e3. This can be done simultaneously by working with the matrix A bordered by I

(A|I)=( 1 1 0 1 0 0 -1 1 1 0 1 0 2 4 -2 0 0 1 )

Carry out now operations involving linear row combinations and permutations to bring the left side to I

( 1 1 0 1 0 0 -1 1 1 0 1 0 2 4 -2 0 0 1 )∼( 1 1 0 1 0 0 0 2 1 1 1 0 0 2 -2 -2 0 1 )∼( 1 1 0 1 0 0 0 2 1 1 1 0 0 0 -3 -3 -1 1 )∼
∼( 1 1 0 1 0 0 0 2 1 1 1 0 0 0 1 1 13 -13 )∼( 1 1 0 1 0 0 0 2 0 0 23 13 0 0 1 1 13 -13 )∼( 1 1 0 1 0 0 0 1 0 0 13 16 0 0 1 1 13 -13 )∼
( 1 0 0 1 -13 -16 0 1 0 0 13 16 0 0 1 1 13 -13 )

to obtain

A-1=( 1 -13 -16 0 13 16 1 13 -13 )

4.Determinants

Definition. The determinant of a square matrix 𝑨=( 𝒂1 … 𝒂m )∈ℝm×m is a real number

det(A)=| a11 a12 … a1m a21 a22 … a2m ⋮ ⋮ ⋱ ⋮ am1 am2 … am⁡m |∈ℝ

giving the (oriented) volume of the parallelepiped spanned by matrix column vectors.

4.1.Cross product