Professional Documents
Culture Documents
Direct Methods For Solving Linear Systems Matrix Factorization
Direct Methods For Solving Linear Systems Matrix Factorization
Direct Methods For Solving Linear Systems Matrix Factorization
Matrix Factorization
Numerical Analysis (9th Edition)
R L Burden & J D Faires
Beamer Presentation Slides
prepared by
John Carroll
Dublin City University
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Outline
Matrix Factorization
2 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Outline
Matrix Factorization
2 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Outline
Matrix Factorization
2 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Outline
Matrix Factorization
2 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Outline
Matrix Factorization
2 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Outline
Matrix Factorization
3 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Background
Matrix Factorization
4 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Background
Gaussian elimination is the principal tool in the direct solution of
linear systems of equations.
Matrix Factorization
4 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Background
Gaussian elimination is the principal tool in the direct solution of
linear systems of equations.
We will now see that the steps used to solve a system of the form
Ax = b can be used to factor a matrix.
Matrix Factorization
4 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Background
Gaussian elimination is the principal tool in the direct solution of
linear systems of equations.
We will now see that the steps used to solve a system of the form
Ax = b can be used to factor a matrix.
The factorization is particularly useful when it has the form
A = LU, where L is lower triangular and U is upper triangular.
Matrix Factorization
4 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Background
Gaussian elimination is the principal tool in the direct solution of
linear systems of equations.
We will now see that the steps used to solve a system of the form
Ax = b can be used to factor a matrix.
The factorization is particularly useful when it has the form
A = LU, where L is lower triangular and U is upper triangular.
Although not all matrices have this type of representation, many
do that occur frequently in the application of numerical techniques.
Matrix Factorization
4 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Matrix Factorization
5 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Matrix Factorization
5 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Matrix Factorization
5 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Solution Strategy
Suppose that A has been factored into the triangular form A = LU,
where L is lower triangular and U is upper triangular.
Matrix Factorization
6 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Solution Strategy
Suppose that A has been factored into the triangular form A = LU,
where L is lower triangular and U is upper triangular. Then we can
solve for x more easily by using a two-step process:
Matrix Factorization
6 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Solution Strategy
Suppose that A has been factored into the triangular form A = LU,
where L is lower triangular and U is upper triangular. Then we can
solve for x more easily by using a two-step process:
First we let y = Ux and solve the lower triangular system Ly = b
for y. Since L is triangular, determining y from this equation
requires only O(n2 ) operations.
Matrix Factorization
6 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Solution Strategy
Suppose that A has been factored into the triangular form A = LU,
where L is lower triangular and U is upper triangular. Then we can
solve for x more easily by using a two-step process:
First we let y = Ux and solve the lower triangular system Ly = b
for y. Since L is triangular, determining y from this equation
requires only O(n2 ) operations.
Once y is known, the upper triangular system Ux = y requires
only an additional O(n2 ) operations to determine the solution x.
Matrix Factorization
6 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Solution Strategy
Suppose that A has been factored into the triangular form A = LU,
where L is lower triangular and U is upper triangular. Then we can
solve for x more easily by using a two-step process:
First we let y = Ux and solve the lower triangular system Ly = b
for y. Since L is triangular, determining y from this equation
requires only O(n2 ) operations.
Once y is known, the upper triangular system Ux = y requires
only an additional O(n2 ) operations to determine the solution x.
Solving a linear system Ax = b in factored form means that the
number of operations needed to solve the system Ax = b is reduced
from O(n3 /3) to O(2n2 ).
Numerical Analysis (Chapter 6)
Matrix Factorization
6 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Outline
Matrix Factorization
7 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Constructing L & U
First, suppose that Gaussian elimination can be performed on the
system Ax = b without row interchanges.
Matrix Factorization
8 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Constructing L & U
First, suppose that Gaussian elimination can be performed on the
system Ax = b without row interchanges.
With the notation used earlier, this is equivalent to having nonzero
(i)
pivot elements aii , for each i = 1, 2, . . . , n.
Matrix Factorization
8 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Constructing L & U
First, suppose that Gaussian elimination can be performed on the
system Ax = b without row interchanges.
With the notation used earlier, this is equivalent to having nonzero
(i)
pivot elements aii , for each i = 1, 2, . . . , n.
The first step in the Gaussian elimination process consists of
performing, for each j = 2, 3, . . . , n, the operations
(1)
where mj,1 =
Matrix Factorization
aj1
(1)
a11
8 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Constructing L & U
First, suppose that Gaussian elimination can be performed on the
system Ax = b without row interchanges.
With the notation used earlier, this is equivalent to having nonzero
(i)
pivot elements aii , for each i = 1, 2, . . . , n.
The first step in the Gaussian elimination process consists of
performing, for each j = 2, 3, . . . , n, the operations
(1)
where mj,1 =
aj1
(1)
a11
These operations transform the system into one in which all the
entries in the first column below the diagonal are zero.
Numerical Analysis (Chapter 6)
Matrix Factorization
8 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
where mj,1 =
aj1
(1)
a11
Matrix Factorization
9 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
where mj,1 =
aj1
(1)
a11
1
0 0
..
m21 1 . . .
.
..
..
.. ..
M (1) =
.
. .
.
0
..
.. . . . .
.
.
.
.
0
mn1 0 0 1
Numerical Analysis (Chapter 6)
Matrix Factorization
9 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
where mj,1 =
aj1
(1)
a11
1
0 0
..
m21 1 . . .
.
..
..
.. ..
M (1) =
.
. .
.
0
..
.. . . . .
.
.
.
.
0
mn1 0 0 1
Matrix Factorization
9 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Constructing L & U (Contd)
We denote the product of this matrix with A(1) A by A(2) and
with b by b(2) ,
Matrix Factorization
10 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Constructing L & U (Contd)
We denote the product of this matrix with A(1) A by A(2) and
with b by b(2) , so
A(2) x = M (1) Ax = M (1) b = b(2)
Matrix Factorization
10 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Constructing L & U (Contd)
We denote the product of this matrix with A(1) A by A(2) and
with b by b(2) , so
A(2) x = M (1) Ax = M (1) b = b(2)
In a similar manner we construct M (2) , the identity matrix with the
entries below the diagonal in the second column replaced by the
negatives of the multipliers
(2)
mj,2 =
aj2
(2)
a22
Matrix Factorization
10 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Matrix Factorization
11 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Matrix Factorization
11 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Constructing L & U (Contd)
In general, with A(k ) x = b(k ) already formed,
Matrix Factorization
12 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Constructing L & U (Contd)
In general, with A(k ) x = b(k ) already formed, multiply by the k th
Gaussian transformation matrix
1 0
0
..
..
.
0 1
.
.
.
.
.
.
. .
..
..
. ..
.
.
.
.
..
..
..
M (k ) = ..
0
.
..
..
.. ..
.
.
.
. mk +1,k
.
.
.
..
..
.. .. ..
..
.
.
. 0
.
.
..
0 0 1
. 0
m
n,k
Matrix Factorization
12 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Constructing L & U (Contd)
to obtain
A(k +1) x = M (k ) A(k ) x
Matrix Factorization
13 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Constructing L & U (Contd)
to obtain
A(k +1) x = M (k ) A(k ) x
= M (k ) M (1) Ax
Matrix Factorization
13 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Constructing L & U (Contd)
to obtain
A(k +1) x = M (k ) A(k ) x
= M (k ) M (1) Ax
= M (k ) b(k )
Matrix Factorization
13 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Constructing L & U (Contd)
to obtain
A(k +1) x = M (k ) A(k ) x
= M (k ) M (1) Ax
= M (k ) b(k )
= b(k +1)
Matrix Factorization
13 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Constructing L & U (Contd)
to obtain
A(k +1) x = M (k ) A(k ) x
= M (k ) M (1) Ax
= M (k ) b(k )
= b(k +1)
= M (k ) M (1) b
Numerical Analysis (Chapter 6)
Matrix Factorization
13 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Constructing L & U (Contd)
The process ends with the formation of A(n) x = b(n) , where A(n) is the
upper triangular matrix
(1)
(1)
(1)
a11 a12 a1n
..
0 a(2) . . .
22
.
.
.
.
.
(n)
..
.. ..
..
A = ..
.. ..
(n1)
..
.
. an1,n
(n)
0
0
an,n
Matrix Factorization
14 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Constructing L & U (Contd)
The process ends with the formation of A(n) x = b(n) , where A(n) is the
upper triangular matrix
(1)
(1)
(1)
a11 a12 a1n
..
0 a(2) . . .
22
.
.
.
.
.
(n)
..
.. ..
..
A = ..
.. ..
(n1)
..
.
. an1,n
(n)
0
0
an,n
given by
Matrix Factorization
14 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Constructing L & U (Contd)
This process forms the U = A(n) portion of the matrix factorization
A = LU.
Matrix Factorization
15 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Constructing L & U (Contd)
This process forms the U = A(n) portion of the matrix factorization
A = LU.
To determine the complementary lower triangular matrix L,
Matrix Factorization
15 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Constructing L & U (Contd)
This process forms the U = A(n) portion of the matrix factorization
A = LU.
To determine the complementary lower triangular matrix L, first
recall the multiplication of A(k ) x = b(k ) by the Gaussian
transformation of M (k ) used to obtain:
A(k +1) x = M (k ) A(k ) x = M (k ) b(k ) = b(k +1) ,
Matrix Factorization
15 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Constructing L & U (Contd)
This process forms the U = A(n) portion of the matrix factorization
A = LU.
To determine the complementary lower triangular matrix L, first
recall the multiplication of A(k ) x = b(k ) by the Gaussian
transformation of M (k ) used to obtain:
A(k +1) x = M (k ) A(k ) x = M (k ) b(k ) = b(k +1) ,
where M (k ) generates the row operations
(Ej mj,k Ek ) (Ej ),
for j = k + 1, . . . , n.
Matrix Factorization
15 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Constructing L & U (Contd)
To reverse the effects of this transformation and return to A(k ) requires
that the operations (Ej + mj,k Ek ) (Ej ) be performed for each
j = k + 1, . . . , n.
Matrix Factorization
16 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Constructing L & U (Contd)
To reverse the effects of this transformation and return to A(k ) requires
that the operations (Ej + mj,k Ek ) (Ej ) be performed for each
1
j = k + 1, . . . , n. This is equivalent to multiplying by M (k )
:
1 0
0
..
..
.
0 1
.
.
.
..
. .. ..
..
.
.
.
.
h
i1 .
.
.
.
..
..
..
L(k ) = M (k )
= ..
0
.
..
..
.. ..
.
.
.
. mk +1,k
.
.
.
..
..
.. .. ..
..
.
.
. 0
.
.
..
. 0
mn,k
0 0 1
Numerical Analysis (Chapter 6)
Matrix Factorization
16 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Constructing L & U (Contd)
The lower-triangular matrix L in the factorization of A, then, is the
product of the matrices L(k ) :
1
0
..
m21 1 . . .
.
..
..
(1) (2)
(n1)
.
.
.
.. ..
..
L = L L L
= .
.
..
.. . .
..
.
.
.
.
0
mn1 mn,n1 1
Matrix Factorization
17 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Constructing L & U (Contd)
The lower-triangular matrix L in the factorization of A, then, is the
product of the matrices L(k ) :
1
0
..
m21 1 . . .
.
..
..
(1) (2)
(n1)
.
.
.
.. ..
..
L = L L L
= .
.
..
.. . .
..
.
.
.
.
0
mn1 mn,n1 1
since the product of L with the upper-triangular matrix
U = M (n1) M (2) M (1) A gives
Numerical Analysis (Chapter 6)
Matrix Factorization
17 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Constructing L & U (Contd)
LU = L(1) L(2) L(n3) L(n2) L(n1)
M (n1) M (n2) M (n3) M (2) M (1) A
Matrix Factorization
18 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Constructing L & U (Contd)
LU = L(1) L(2) L(n3) L(n2) L(n1)
M (n1) M (n2) M (n3) M (2) M (1) A
= [M (1) ]1 [M (2) ]1 [M (n2) ]1 [M (n1) ]1
M (n1) M (n2) M (2) M (1) A
Matrix Factorization
18 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Constructing L & U (Contd)
LU = L(1) L(2) L(n3) L(n2) L(n1)
M (n1) M (n2) M (n3) M (2) M (1) A
= [M (1) ]1 [M (2) ]1 [M (n2) ]1 [M (n1) ]1
M (n1) M (n2) M (2) M (1) A
= A
Matrix Factorization
18 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Constructing L & U (Contd)
LU = L(1) L(2) L(n3) L(n2) L(n1)
M (n1) M (n2) M (n3) M (2) M (1) A
= [M (1) ]1 [M (2) ]1 [M (n2) ]1 [M (n1) ]1
M (n1) M (n2) M (2) M (1) A
= A
We now state a theorem which follows from these observations.
Numerical Analysis (Chapter 6)
Matrix Factorization
18 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Theorem
If Gaussian elimination can be performed on the linear system Ax = b
without row interchanges,
Matrix Factorization
19 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Theorem
If Gaussian elimination can be performed on the linear system Ax = b
without row interchanges, then the matrix A can be factored into the
product of a lower-triangular matrix L and an upper-triangular matrix U,
Matrix Factorization
19 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Theorem
If Gaussian elimination can be performed on the linear system Ax = b
without row interchanges, then the matrix A can be factored into the
product of a lower-triangular matrix L and an upper-triangular matrix U,
(i) (i)
that is, A = LU, where mji = aji /aii ,
U=
a11
(1)
a12
(1)
0
..
.
..
.
0
a22
..
.
(2)
(1)
a1n
..
..
.
.
..
..
..
.
.
.
..
..
.
. a(n1)
n1,n
(n)
0
an,n
m21
L = ...
.
..
mn1
Matrix Factorization
..
.
1
..
..
..
.
.
.
..
..
..
.
.
.
mn,n1
0
..
.
..
.
0
1
19 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Outline
Matrix Factorization
20 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Example
(a) Determine the LU factorization for matrix A in the linear system
Ax = b, where
1
1
0
3
1
2
1 1
1
and b = 1
A=
3 1 1
3
2
1
2
3 1
4
Matrix Factorization
21 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Example
(a) Determine the LU factorization for matrix A in the linear system
Ax = b, where
1
1
0
3
1
2
1 1
1
and b = 1
A=
3 1 1
3
2
1
2
3 1
4
(b) Then use the factorization to solve the system
x1 + x2
+ 3x4 =
2x1 + x2 x3 + x4 =
3x1 x2 x3 + 2x4 = 14
x1 + 2x2 + 3x3 x4 = 7
Numerical Analysis (Chapter 6)
Matrix Factorization
21 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
22 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
22 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
+ 3x4 =
x2 x3 5x4 = 7
3x3 + 13x4 =
13
13x4 = 13
Numerical Analysis (Chapter 6)
Matrix Factorization
22 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
1
1
0
3
2
1 1
1
A =
3 1 1
2
1
2
3 1
Matrix Factorization
23 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
1
1
0
3
2
1 1
1
A =
3 1 1
2
1
2
3 1
1
0 0 0
1
1
0
3
2
1 0 0
0 1 1 5
=
3
4 1 0
0
0
3
13
1 3 0 1
0
0
0 13
Matrix Factorization
23 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
1
1
0
3
2
1 1
1
A =
3 1 1
2
1
2
3 1
1
0 0 0
1
1
0
3
2
1 0 0
0 1 1 5
=
3
4 1 0
0
0
3
13
1 3 0 1
0
0
0 13
= LU
Numerical Analysis (Chapter 6)
Matrix Factorization
23 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
1
0
2
1
Ax = LUx =
3
4
1 3
8
7
=
14
7
0
0
1
0
0
1
1
0
3
0 1 1 5
0
0 0
0
3
13
1
0
0
0 13
Matrix Factorization
x1
x2
x3
x4
24 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
1
0
2
1
Ax = LUx =
3
4
1 3
8
7
=
14
7
0
0
1
0
0
1
1
0
3
0 1 1 5
0
0 0
0
3
13
1
0
0
0 13
x1
x2
x3
x4
Matrix Factorization
24 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
1
0
2
1
Ax = LUx =
3
4
1 3
8
7
=
14
7
0
0
1
0
0
1
1
0
3
0 1 1 5
0
0 0
0
3
13
1
0
0
0 13
x1
x2
x3
x4
Matrix Factorization
24 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
1
0 0 0
2
1 0 0
Ly =
3
4 1 0
1 3 0 1
y1
8
y2 7
y3 = 14
y4
7
Matrix Factorization
25 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
1
0 0 0
2
1 0 0
Ly =
3
4 1 0
1 3 0 1
y1
8
y2 7
y3 = 14
y4
7
y2 = 7 2y1 = 9
y3 = 14 3y1 4y2 = 26
y1 3y2 + y4 = 7 y4 = 7 + y1 + 3y2 = 26
Numerical Analysis (Chapter 6)
Matrix Factorization
25 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
26 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
1
1
0
3
x1
8
0 1 1 5 x2 9
0
0
3
13 x3 26
0
0
0 13
x4
26
Matrix Factorization
26 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
1
1
0
3
x1
8
0 1 1 5 x2 9
0
0
3
13 x3 26
0
0
0 13
x4
26
Matrix Factorization
26 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Outline
Matrix Factorization
27 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
28 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
28 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
uij , i j n, 1 i n of U.
Matrix Factorization
28 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
29 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
29 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
29 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Step 5 For j = i + 1, . h. . , n
set uij =
lji =
1
lii
1
uii
aij
aji
Pi1
k =1 lik ukj
Pi1
k =1 ljk uki
Matrix Factorization
(ith row of U)
(ith column of L)
R L Burden & J D Faires
29 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Pn1
k =1 lnk ukn
Matrix Factorization
30 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Pn1
k =1 lnk ukn
Matrix Factorization
30 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Matrix Factorization
31 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Matrix Factorization
31 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Matrix Factorization
31 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Matrix Factorization
31 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Using the LU Factorization (Contd)
Since L is lower triangular, we have y1 =
Matrix Factorization
b1
l11
32 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Using the LU Factorization (Contd)
Since L is lower triangular, we have y1 =
i = 2, 3, . . . , n,
b1
and, for each
l11
i1
X
1
yi =
bi
lij yj
lii
j=1
Matrix Factorization
32 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
Using the LU Factorization (Contd)
Since L is lower triangular, we have y1 =
i = 2, 3, . . . , n,
b1
and, for each
l11
i1
X
1
yi =
bi
lij yj
lii
j=1
n
X
yn
1
xn =
and xi =
yi
uij xj
unn
uii
j=i+1
Matrix Factorization
32 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Outline
Matrix Factorization
33 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
34 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
34 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
34 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
35 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Permutation Matrix
An n n permutation matrix P = [pij ] is a matrix obtained by
rearranging the rows of In , the identity matrix. This gives a matrix with
precisely one nonzero entry in each row and in each column, and each
nonzero entry is a 1.
Matrix Factorization
35 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
1 0 0
P= 0 0 1
0 1 0
is a 3 3 permutation matrix.
Matrix Factorization
36 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
1 0 0
P= 0 0 1
0 1 0
1 0 0
a11 a12 a13
PA = 0 0 1 a21 a22 a23
0 1 0
a31 a32 a33
Matrix Factorization
36 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
1 0 0
P= 0 0 1
0 1 0
1 0 0
a11 a12 a13
a11 a12 a13
PA = 0 0 1 a21 a22 a23 = a31 a32 a33
0 1 0
a31 a32 a33
a21 a22 a23
Matrix Factorization
36 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
1 0 0
P= 0 0 1
0 1 0
1 0 0
a11 a12 a13
a11 a12 a13
PA = 0 0 1 a21 a22 a23 = a31 a32 a33
0 1 0
a31 a32 a33
a21 a22 a23
Similarly, multiplying A on the right by P interchanges the second and
third columns of A.
Numerical Analysis (Chapter 6)
Matrix Factorization
36 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
37 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
37 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
38 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
38 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
39 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
39 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
39 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
40 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
40 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
40 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
40 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
40 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Example
Determine a factorization in the form A = (P t L)U for the matrix
0
0 1 1
1
1 1 2
A=
1 1
2 0
1
2
0 2
Matrix Factorization
41 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Example
Determine a factorization in the form A = (P t L)U for the matrix
0
0 1 1
1
1 1 2
A=
1 1
2 0
1
2
0 2
Note
The matrix A cannot have an LU factorization because a11 = 0.
Matrix Factorization
41 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
42 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
42 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
42 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
1 1 1 2
0 0 1 1
0 0
1 2
0 1
1 0
Matrix Factorization
42 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
1 1 1 2
0 0 1 1
0 0
1 2
0 1
1 0
Matrix Factorization
42 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
1 1 1 2
0 0 1 1
0 0
1 2
0 1
1 0
Matrix Factorization
42 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
1 1 1 2
0 0 1 1
0 0
1 2
0 1
1 0
1 1 1 2
0 1
1 0
U=
0 0
1 2
0 0
0 3
Numerical Analysis (Chapter 6)
Matrix Factorization
42 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
43 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
43 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
0 1 0 0
0 0 0 1
P=
0 0 1 0
1 0 0 0
Matrix Factorization
43 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
0 1 0 0
0 0 0 1
P=
0 0 1 0
1 0 0 0
and
1
1 1
1
2
0
PA =
1 1
2
0
0 1
Numerical Analysis (Chapter 6)
Matrix Factorization
2
2
0
1
R L Burden & J D Faires
43 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
44 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Matrix Factorization
44 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
m31 = 1,
1 0
0 0
1 1
0 0
PA =
1 0
1 0
0 0 1 1
Matrix Factorization
and m43 = 1,
1
0
0
0
1 1 2
1
1 0
= LU
0
1 2
0
0 3
44 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Solution (4/4)
Multiplying by P 1 = P t produces the factorization
A = P 1 (LU) = P t (LU) = (P t L)U
Matrix Factorization
45 / 46
Rationale
Constructing LU
Example
Algorithm
Permutation Matrices
Solution (4/4)
Multiplying by P 1 = P t produces the factorization
A = P 1 (LU) = P t (LU) = (P t L)U
0
1
=
1
1
0 1 1
1 1 1 2
0
0 0
1 0
0 1
0
1 0
0 0
1 2
1
0 0
0 0
0 3
Matrix Factorization
45 / 46
Questions?