Professional Documents
Culture Documents
Lecture Notes 04-LU-Factorization PDF
Lecture Notes 04-LU-Factorization PDF
Matrix Factorization
Outline
Outline
Outline
Outline
Outline
Outline
Matrix Factorization
Background
Matrix Factorization
Background
Gaussian elimination is the principal tool in the direct solution of
linear systems of equations.
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
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
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
Matrix Factorization
Matrix Factorization
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
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
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
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
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 ).
Outline
Matrix Factorization
Constructing L & U
First, suppose that Gaussian elimination can be performed on the
system Ax = b without row interchanges.
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
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)
aj1
(Ej mj,1 E1 ) (Ej ), where mj,1 = (1)
a11
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)
aj1
(Ej mj,1 E1 ) (Ej ), where mj,1 = (1)
a11
These operations transform the system into one in which all the
entries in the first column below the diagonal are zero.
Matrix Factorization
Matrix Factorization
Matrix Factorization
Matrix Factorization
Matrix Factorization
Matrix Factorization
Matrix Factorization
Matrix Factorization
Matrix Factorization
= M (k ) M (1) Ax
Matrix Factorization
= M (k ) M (1) Ax
= M (k ) b(k )
Matrix Factorization
= M (k ) M (1) Ax
= M (k ) b(k )
= b(k +1)
Matrix Factorization
= M (k ) M (1) Ax
= M (k ) b(k )
= b(k +1)
= M (k ) M (1) b
Matrix Factorization
Matrix Factorization
given by
A(n) = M (n1) M (n2) M (1) A
Matrix Factorization
Matrix Factorization
Matrix Factorization
Matrix Factorization
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
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. This is equivalent to multiplying by M (k )
1
:
1 0 0
.. ..
0 1 . .
. .
. .. .. ..
. . . . ..
h i1 . . . .
L(k ) = M (k ) = .. 0 .. .. ..
. .. .. .. ..
. . .
. . mk +1,k .
. .. .. .. .. ..
.. . . . . . 0
..
. 0 mn,k 0 0 1
Matrix Factorization
Matrix Factorization
Matrix Factorization
Matrix Factorization
Matrix Factorization
= A
Matrix Factorization
= A
Matrix Factorization
Theorem
If Gaussian elimination can be performed on the linear system Ax = b
without row interchanges,
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
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 ,
(1) (1) (1)
a11 a12 a1n
1 0 0
(2) .. .. .. ..
.
0 a22 .
m21 1 . .
.. ..
L = ... ..
U= .. .. .. .. .. ..
. . . . .
. . . .
.. .. .. . .. .. ..
. a(n1) ..
. . n1,n
. . . 0
(n) mn1 mn,n1 1
0 0 an,n
Outline
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 2 3
1 2 3 1 4
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 2 3
1 2 3 1 4
x1 + x2 + 3x4 = 8
2x1 + x2 x3 + x4 = 7
3x1 x2 x3 + 2x4 = 14
x1 + 2x2 + 3x3 x4 = 7
x1 + x2 + 3x4 = 4
x2 x3 5x4 = 7
3x3 + 13x4 = 13
13x4 = 13
= LU
y1 = 8
2y1 + y2 = 7 y2 = 7 2y1 = 9
3y1 + 4y2 + y3 = 14 y3 = 14 3y1 4y2 = 26
y1 3y2 + y4 = 7 y4 = 7 + y1 + 3y2 = 26
Outline
Pn1
Step 6 Select lnn and unn satisfying lnn unn = ann k =1 lnk ukn
Pn1
Step 6 Select lnn and unn satisfying lnn unn = ann k =1 lnk ukn
Matrix Factorization
Matrix Factorization
Matrix Factorization
Matrix Factorization
Matrix Factorization
Matrix Factorization
Matrix Factorization
Outline
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.
Example
The matrix
1 0 0
P= 0 0 1
0 1 0
is a 3 3 permutation matrix.
Example
The matrix
1 0 0
P= 0 0 1
0 1 0
is a 3 3 permutation matrix. For any 3 3 matrix A, multiplying on the
left by P has the effect of interchanging the second and third rows of A:
1 0 0 a11 a12 a13
PA = 0 0 1 a21 a22 a23
0 1 0 a31 a32 a33
Example
The matrix
1 0 0
P= 0 0 1
0 1 0
is a 3 3 permutation matrix. For any 3 3 matrix A, multiplying on the
left by P has the effect of interchanging the second and third rows of A:
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
Example
The matrix
1 0 0
P= 0 0 1
0 1 0
is a 3 3 permutation matrix. For any 3 3 matrix A, multiplying on the
left by P has the effect of interchanging the second and third rows of A:
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
P 1 exists and P 1 = P t .
PAx = Pb
PAx = Pb
PAx = Pb
A = P 1 LU = (P t L)U.
PAx = Pb
A = P 1 LU = (P t L)U.
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
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.
Solution (1/4)
However, using the row interchange (E1 ) (E2 ),
Solution (1/4)
However, using the row interchange (E1 ) (E2 ), followed by
(E3 + E1 ) (E3 )
Solution (1/4)
However, using the row interchange (E1 ) (E2 ), followed by
(E3 + E1 ) (E3 ) and (E4 E1 ) (E4 ),
Solution (1/4)
However, using the row interchange (E1 ) (E2 ), followed by
(E3 + E1 ) (E3 ) and (E4 E1 ) (E4 ), produces
1 1 1 2
0 0 1 1
0 0 1 2
0 1 1 0
Solution (1/4)
However, using the row interchange (E1 ) (E2 ), followed by
(E3 + E1 ) (E3 ) and (E4 E1 ) (E4 ), produces
1 1 1 2
0 0 1 1
0 0 1 2
0 1 1 0
Solution (1/4)
However, using the row interchange (E1 ) (E2 ), followed by
(E3 + E1 ) (E3 ) and (E4 E1 ) (E4 ), produces
1 1 1 2
0 0 1 1
0 0 1 2
0 1 1 0
Solution (1/4)
However, using the row interchange (E1 ) (E2 ), followed by
(E3 + E1 ) (E3 ) and (E4 E1 ) (E4 ), produces
1 1 1 2
0 0 1 1
0 0 1 2
0 1 1 0
Solution (2/4)
The permutation matrix associated with the row interchanges
Solution (2/4)
The permutation matrix associated with the row interchanges
(E1 ) (E2 ) and (E2 ) (E4 )
Solution (2/4)
The permutation matrix associated with the row interchanges
(E1 ) (E2 ) and (E2 ) (E4 ) is
0 1 0 0
0 0 0 1
P= 0 0 1 0
1 0 0 0
Solution (2/4)
The permutation matrix associated with the row interchanges
(E1 ) (E2 ) and (E2 ) (E4 ) is
0 1 0 0
0 0 0 1
P= 0 0 1 0
1 0 0 0
and
1 1 1 2
1 2 0 2
PA =
1 1 2 0
0 0 1 1
Solution (3/4)
Gaussian elimination is performed on PA using the same
operations as on A, except without the row interchanges.
Solution (3/4)
Gaussian elimination is performed on PA using the same
operations as on A, except without the row interchanges.
That is, (E2 E1 ) (E2 ), (E3 + E1 ) (E3 ), followed by
(E4 + E3 ) (E4 ).
Solution (3/4)
Gaussian elimination is performed on PA using the same
operations as on A, except without the row interchanges.
That is, (E2 E1 ) (E2 ), (E3 + E1 ) (E3 ), followed by
(E4 + E3 ) (E4 ).
The nonzero multipliers for PA are consequently,
Solution (4/4)
Multiplying by P 1 = P t produces the factorization
Solution (4/4)
Multiplying by P 1 = P t produces the factorization
0 0 1 1 1 1 1 2
1 0 0 0
0 1 1 0
=
1 0 1 0 0 0 1 2
1 1 0 0 0 0 0 3