Direct Methods for Solving Linear Systems. Matrix Factorization

Similar documents
2.1 Gaussian Elimination

1 Multiply Eq. E i by λ 0: (λe i ) (E i ) 2 Multiply Eq. E j by λ and add to Eq. E i : (E i + λe j ) (E i )

CS412: Lecture #17. Mridul Aanjaneya. March 19, 2015

Gaussian Elimination and Back Substitution

Direct Methods for Solving Linear Systems. Simon Fraser University Surrey Campus MACM 316 Spring 2005 Instructor: Ha Le

Linear Algebra Section 2.6 : LU Decomposition Section 2.7 : Permutations and transposes Wednesday, February 13th Math 301 Week #4

AMS526: Numerical Analysis I (Numerical Linear Algebra)

CHAPTER 6. Direct Methods for Solving Linear Systems

The Solution of Linear Systems AX = B

Numerical Linear Algebra

1.5 Gaussian Elimination With Partial Pivoting.

Linear Systems of n equations for n unknowns

MATH 3511 Lecture 1. Solving Linear Systems 1

5 Solving Systems of Linear Equations

SOLVING LINEAR SYSTEMS

AMS 209, Fall 2015 Final Project Type A Numerical Linear Algebra: Gaussian Elimination with Pivoting for Solving Linear Systems

Gaussian Elimination without/with Pivoting and Cholesky Decomposition

Pivoting. Reading: GV96 Section 3.4, Stew98 Chapter 3: 1.3

Numerical Differentiation & Integration. Numerical Differentiation II

LU Factorization. Marco Chiarandini. DM559 Linear and Integer Programming. Department of Mathematics & Computer Science University of Southern Denmark

COURSE Numerical methods for solving linear systems. Practical solving of many problems eventually leads to solving linear systems.

. =. a i1 x 1 + a i2 x 2 + a in x n = b i. a 11 a 12 a 1n a 21 a 22 a 1n. i1 a i2 a in

4.2 Floating-Point Numbers

Numerical Linear Algebra

Fundamentals of Engineering Analysis (650163)

Lecture 12 (Tue, Mar 5) Gaussian elimination and LU factorization (II)

Scientific Computing

Roundoff Analysis of Gaussian Elimination

This can be accomplished by left matrix multiplication as follows: I

Linear Algebra and Matrix Inversion

Draft. Lecture 12 Gaussian Elimination and LU Factorization. MATH 562 Numerical Analysis II. Songting Luo

CME 302: NUMERICAL LINEAR ALGEBRA FALL 2005/06 LECTURE 6

Computational Linear Algebra

Linear Algebraic Equations

LU Factorization. LU Decomposition. LU Decomposition. LU Decomposition: Motivation A = LU

Numerical Methods I Solving Square Linear Systems: GEM and LU factorization

Chapter 1: Systems of linear equations and matrices. Section 1.1: Introduction to systems of linear equations

Section 3.5 LU Decomposition (Factorization) Key terms. Matrix factorization Forward and back substitution LU-decomposition Storage economization

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS. + + x 1 x 2. x n 8 (4) 3 4 2

Computational Methods. Systems of Linear Equations

Linear Algebra. Solving Linear Systems. Copyright 2005, W.R. Winfrey

Linear Equations and Matrix

MAT 343 Laboratory 3 The LU factorization

7.6 The Inverse of a Square Matrix

MTH 464: Computational Linear Algebra

MODULE 7. where A is an m n real (or complex) matrix. 2) Let K(t, s) be a function of two variables which is continuous on the square [0, 1] [0, 1].

LU Factorization. LU factorization is the most common way of solving linear systems! Ax = b LUx = b

Lecture 2 INF-MAT : , LU, symmetric LU, Positve (semi)definite, Cholesky, Semi-Cholesky

Dense LU factorization and its error analysis

Chapter 2. Solving Systems of Equations. 2.1 Gaussian elimination

Section 9.2: Matrices. Definition: A matrix A consists of a rectangular array of numbers, or elements, arranged in m rows and n columns.

MATRICES. a m,1 a m,n A =

Numerical Linear Algebra

Program Lecture 2. Numerical Linear Algebra. Gaussian elimination (2) Gaussian elimination. Decompositions, numerical aspects

1.Chapter Objectives

30.3. LU Decomposition. Introduction. Prerequisites. Learning Outcomes

Solving Linear Systems Using Gaussian Elimination. How can we solve

Section 5.6. LU and LDU Factorizations

MTH 215: Introduction to Linear Algebra

NUMERICAL MATHEMATICS & COMPUTING 7th Edition

GAUSSIAN ELIMINATION AND LU DECOMPOSITION (SUPPLEMENT FOR MA511)

Today s class. Linear Algebraic Equations LU Decomposition. Numerical Methods, Fall 2011 Lecture 8. Prof. Jinbo Bi CSE, UConn

Numerical Differentiation & Integration. Numerical Differentiation III

7. LU factorization. factor-solve method. LU factorization. solving Ax = b with A nonsingular. the inverse of a nonsingular matrix

MAC Module 2 Systems of Linear Equations and Matrices II. Learning Objectives. Upon completing this module, you should be able to :

Numerical Methods - Numerical Linear Algebra

MATH2210 Notebook 2 Spring 2018

The System of Linear Equations. Direct Methods. Xiaozhou Li.

Solution of Linear Equations

Initial-Value Problems for ODEs. Introduction to Linear Multistep Methods

Matrix decompositions

Solving Linear Systems of Equations

Gaussian Elimination for Linear Systems

Matrix decompositions

MODEL ANSWERS TO THE THIRD HOMEWORK

Review of matrices. Let m, n IN. A rectangle of numbers written like A =

Interpolation & Polynomial Approximation. Hermite Interpolation I

Practical Linear Algebra: A Geometry Toolbox

14.2 QR Factorization with Column Pivoting

The following steps will help you to record your work and save and submit it successfully.

Applied Linear Algebra

April 26, Applied mathematics PhD candidate, physics MA UC Berkeley. Lecture 4/26/2013. Jed Duersch. Spd matrices. Cholesky decomposition

Matrix Algebra. Matrix Algebra. Chapter 8 - S&B

Linear Equations in Linear Algebra

STAT 309: MATHEMATICAL COMPUTATIONS I FALL 2018 LECTURE 13

7.5 Operations with Matrices. Copyright Cengage Learning. All rights reserved.

Illustration of Gaussian elimination to find LU factorization. A = a 11 a 12 a 13 a 14 a 21 a 22 a 23 a 24 a 31 a 32 a 33 a 34 a 41 a 42 a 43 a 44

Applied Mathematics 205. Unit II: Numerical Linear Algebra. Lecturer: Dr. David Knezevic

MAC Module 1 Systems of Linear Equations and Matrices I

MATLAB Project: LU Factorization

Hani Mehrpouyan, California State University, Bakersfield. Signals and Systems

Lecture Notes to Accompany. Scientific Computing An Introductory Survey. by Michael T. Heath. Chapter 2. Systems of Linear Equations

Jordan Journal of Mathematics and Statistics (JJMS) 5(3), 2012, pp A NEW ITERATIVE METHOD FOR SOLVING LINEAR SYSTEMS OF EQUATIONS

Scientific Computing: An Introductory Survey

Chapter 4 No. 4.0 Answer True or False to the following. Give reasons for your answers.

Math 240 Calculus III

Matrix Factorization Reading: Lay 2.5

1 Determinants. 1.1 Determinant

A Review of Matrix Analysis

Next topics: Solving systems of linear equations

Transcription:

Direct Methods for Solving Linear Systems Matrix Factorization Numerical Analysis (9th Edition) R L Burden & J D Faires Beamer Presentation Slides prepared by John Carroll Dublin City University c 2011 Brooks/Cole, Cengage Learning

Outline 1 Computation Cost Rationale & Basic Solution Strategy 2 Constructing the Matrix Factorization 3 Example: LU Factorization of a 4 4 Matrix 4 The LU Factorization Algorithm 5 Permutation Matrices for Row Interchanges Numerical Analysis (Chapter 6) Matrix Factorization R L Burden & J D Faires 2 / 46

Outline 1 Computation Cost Rationale & Basic Solution Strategy 2 Constructing the Matrix Factorization 3 Example: LU Factorization of a 4 4 Matrix 4 The LU Factorization Algorithm 5 Permutation Matrices for Row Interchanges Numerical Analysis (Chapter 6) Matrix Factorization R L Burden & J D Faires 3 / 46

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. Numerical Analysis (Chapter 6) Matrix Factorization R L Burden & J D Faires 4 / 46

Matrix Factorization Computational Cost Considerations Gaussian elimination applied to an arbitrary linear system Ax = b requires O(n 3 /3) arithmetic operations to determine x. However, to solve a linear system that involves an upper-triangular system requires only backward substitution, which takes O(n 2 ) operations. The number of operations required to solve a lower-triangular systems is similar. Numerical Analysis (Chapter 6) Matrix Factorization R L Burden & J D Faires 5 / 46

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(n 2 ) operations. Once y is known, the upper triangular system Ux = y requires only an additional O(n 2 ) 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(n 3 /3) to O(2n 2 ). Numerical Analysis (Chapter 6) Matrix Factorization R L Burden & J D Faires 6 / 46

Outline 1 Computation Cost Rationale & Basic Solution Strategy 2 Constructing the Matrix Factorization 3 Example: LU Factorization of a 4 4 Matrix 4 The LU Factorization Algorithm 5 Permutation Matrices for Row Interchanges Numerical Analysis (Chapter 6) Matrix Factorization R L Burden & J D Faires 7 / 46

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 pivot elements a (i) ii, 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 (E j m j,1 E 1 ) (E j ), where m j,1 = a(1) j1 a (1) 11 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 R L Burden & J D Faires 8 / 46

Matrix Factorization: Constructing L & U (Cont d) The system of operations in (E j m j,1 E 1 ) (E j ), where m j,1 = a(1) j1 a (1) 11 can be viewed in another way. It is simultaneously accomplished by multiplying the original matrix A on the left by the matrix 1 0 0 m 21 1.... M (1) =. 0............... 0 m n1 0 0 1 This is called the first Gaussian transformation matrix. Numerical Analysis (Chapter 6) Matrix Factorization R L Burden & J D Faires 9 / 46

Matrix Factorization Constructing L & U (Cont d) 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 m j,2 = a(2) j2 a (2) 22. Numerical Analysis (Chapter 6) Matrix Factorization R L Burden & J D Faires 10 / 46

Matrix Factorization Constructing L & U (Cont d) The product of M (2) with A (2) has zeros below the diagonal in the first two columns, and we let A (3) x = M (2) A (2) x = M (2) M (1) Ax = M (2) M (1) b = b (3) Numerical Analysis (Chapter 6) Matrix Factorization R L Burden & J D Faires 11 / 46

Matrix Factorization Constructing L & U (Cont d) In general, with A (k) x = b (k) already formed, multiply by the kth Gaussian transformation matrix 1 0 0. 0 1.............. M (k). =. 0......... m..... k+1,k............. 0. 0 m n,k 0 0 1 Numerical Analysis (Chapter 6) Matrix Factorization R L Burden & J D Faires 12 / 46

Matrix Factorization Constructing L & U (Cont d) 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 R L Burden & J D Faires 13 / 46

Matrix Factorization Constructing L & U (Cont d) The process ends with the formation of A (n) x = b (n), where A (n) is the upper triangular matrix a (1) 11 a (1) 12 a (1) 1n 0 a (2)... A (n) 22. =.................. (n 1) a n 1,n 0 0 a n,n (n) given by A (n) = M (n 1) M (n 2) M (1) A Numerical Analysis (Chapter 6) Matrix Factorization R L Burden & J D Faires 14 / 46

Matrix Factorization Constructing L & U (Cont d) 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 (E j m j,k E k ) (E j ), for j = k + 1,...,n. Numerical Analysis (Chapter 6) Matrix Factorization R L Burden & J D Faires 15 / 46

Matrix Factorization Constructing L & U (Cont d) To reverse the effects of this transformation and return to A (k) requires that the operations (E j + m j,k E k ) (E j ) be performed for each j = k + 1,...,n. This is equivalent to multiplying by [ M (k)] 1 : 1 0 0. 0 1.............. [ L (k) = M (k)] 1. =. 0......... m..... k+1,k............. 0. 0 m n,k 0 0 1 Numerical Analysis (Chapter 6) Matrix Factorization R L Burden & J D Faires 16 / 46

Matrix Factorization Constructing L & U (Cont d) The lower-triangular matrix L in the factorization of A, then, is the product of the matrices L (k) : 1 0 0. m 21 1... L = L (1) L (2) L (n 1) =................... 0 m n1 m n,n 1 1 since the product of L with the upper-triangular matrix U = M (n 1) M (2) M (1) A gives Numerical Analysis (Chapter 6) Matrix Factorization R L Burden & J D Faires 17 / 46

Matrix Factorization Constructing L & U (Cont d) LU = L (1) L (2) L (n 3) L (n 2) L (n 1) M (n 1) M (n 2) M (n 3) M (2) M (1) A = [M (1) ] 1 [M (2) ] 1 [M (n 2) ] 1 [M (n 1) ] 1 M (n 1) M (n 2) M (2) M (1) A = A We now state a theorem which follows from these observations. Numerical Analysis (Chapter 6) Matrix Factorization R L Burden & J D Faires 18 / 46

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, that is, A = LU, where m ji = a (i) ji /a (i) ii, U = a (1) 11 a (1) 12 a (1) 1n 0 a (2)... 22................... a (n 1) n 1,n 0 0 a (n) n,n 1 0 0. m 21 1... L =................... 0 m n1 m n,n 1 1 Numerical Analysis (Chapter 6) Matrix Factorization R L Burden & J D Faires 19 / 46

Outline 1 Computation Cost Rationale & Basic Solution Strategy 2 Constructing the Matrix Factorization 3 Example: LU Factorization of a 4 4 Matrix 4 The LU Factorization Algorithm 5 Permutation Matrices for Row Interchanges Numerical Analysis (Chapter 6) Matrix Factorization R L Burden & J D Faires 20 / 46

Matrix Factorization Example (a) Determine the LU factorization for matrix A in the linear system Ax = b, where 1 1 0 3 1 A = 2 1 1 1 3 1 1 2 and b = 1 3 1 2 3 1 4 (b) Then use the factorization to solve the system x 1 + x 2 + 3x 4 = 8 2x 1 + x 2 x 3 + x 4 = 7 3x 1 x 2 x 3 + 2x 4 = 14 x 1 + 2x 2 + 3x 3 x 4 = 7 Numerical Analysis (Chapter 6) Matrix Factorization R L Burden & J D Faires 21 / 46

Matrix Factorization: 4 4 Example Part (a) Solution (1/2) The original system was considered under Gaussian Elimination where we saw that the sequence of operations (E 2 2E 1 ) (E 2 ) (E 3 3E 1 ) (E 3 ) (E 4 ( 1)E 1 ) (E 4 ) (E 3 4E 2 ) (E 3 ) (E 4 ( 3)E 2 ) (E 4 ) converts the system to the triangular system x 1 + x 2 + 3x 4 = 4 x 2 x 3 5x 4 = 7 3x 3 + 13x 4 = 13 13x 4 = 13 Numerical Analysis (Chapter 6) Matrix Factorization R L Burden & J D Faires 22 / 46

Matrix Factorization: 4 4 Example Part (a) Solution (2/2) The multipliers m ij and the upper triangular matrix produce the factorization 1 1 0 3 A = 2 1 1 1 3 1 1 2 1 2 3 1 = = LU 1 0 0 0 2 1 0 0 3 4 1 0 1 3 0 1 1 1 0 3 0 1 1 5 0 0 3 13 0 0 0 13 Numerical Analysis (Chapter 6) Matrix Factorization R L Burden & J D Faires 23 / 46

Matrix Factorization: 4 4 Example Part (b) Solution (1/3) To solve Ax = LUx = = 1 0 0 0 2 1 0 0 3 4 1 0 1 3 0 1 8 7 14 7 1 1 0 3 0 1 1 5 0 0 3 13 0 0 0 13 we first introduce the substitution y = Ux. Then b = L(Ux) = Ly. x 1 x 2 x 3 x 4 Numerical Analysis (Chapter 6) Matrix Factorization R L Burden & J D Faires 24 / 46

Matrix Factorization: 4 4 Example Part (b) Solution (2/3) First, solve Ly = b (where y = Ux: 1 0 0 0 Ly = 2 1 0 0 3 4 1 0 1 3 0 1 y 1 y 2 y 3 y 4 = 8 7 14 7 This system is solved for y by a simple forward-substitution process: y 1 = 8 2y 1 + y 2 = 7 y 2 = 7 2y 1 = 9. 3y 1 + 4y 2 + y 3 = 14 y 3 = 14 3y 1 4y 2 = 26 y 1 3y 2 + y 4 = 7 y 4 = 7 + y 1 + 3y 2 = 26 Numerical Analysis (Chapter 6) Matrix Factorization R L Burden & J D Faires 25 / 46

Matrix Factorization: 4 4 Example Part (b) Solution (3/3) We then solve Ux = y for x, the solution of the original system; that is, 1 1 0 3 x 1 8 0 1 1 5 x 2 0 0 3 13 x 3 = 9 26 0 0 0 13 x 4 26 Using backward substitution we obtain x 4 = 2, x 3 = 0, x 2 = 1, x 1 = 3. Numerical Analysis (Chapter 6) Matrix Factorization R L Burden & J D Faires 26 / 46

Outline 1 Computation Cost Rationale & Basic Solution Strategy 2 Constructing the Matrix Factorization 3 Example: LU Factorization of a 4 4 Matrix 4 The LU Factorization Algorithm 5 Permutation Matrices for Row Interchanges Numerical Analysis (Chapter 6) Matrix Factorization R L Burden & J D Faires 27 / 46

LU Factorization Algorithm (1/3) To factor the n n matrix A = [a ij ] into the product of the lower-triangular matrix L = [l ij ] and the upper-triangular matrix U = [u ij ]; that is, A = LU, where the main diagonal of either L or U consists of all ones: INPUT dimension n; the entries a ij, 1 i, j n of A; the diagonal l 11 = = l nn = 1 of L or the diagonal u 11 = = u nn = 1 of U. OUTPUT the entries l ij, 1 j i, 1 i n of L and the entries, u ij, i j n, 1 i n of U. Numerical Analysis (Chapter 6) Matrix Factorization R L Burden & J D Faires 28 / 46

LU Factorization Algorithm (2/3) Step 1 Select l 11 and u 11 satisfying l 11 u 11 = a 11 If l 11 u 11 = 0 then OUTPUT ( Factorization impossible ) STOP Step 2 For j = 2,...,n set u 1j = a 1j /l 11 (First row of U) l j1 = a j1 /u 11 (First column of L) Step 3 For i = 2,...,n 1 do Steps 4 and 5: Step 4 Step 5 Select l ii and u ii satisfying l ii u ii = a ii i 1 k=1 l iku ki If l ii u ii = 0 then OUTPUT ( Factorization impossible ) STOP For j = i + 1,...,n set u ij = 1 l ii [ a ij i 1 k=1 l iku kj ] l ji = 1 u ii [ a ji i 1 k=1 l jku ki ] (ith row of U) (ith column of L) Numerical Analysis (Chapter 6) Matrix Factorization R L Burden & J D Faires 29 / 46

LU Factorization Algorithm (3/3) Step 6 Select l nn and u nn satisfying l nn u nn = a nn n 1 k=1 l nku kn (Note: If l nn u nn = 0, then A = LU but A is singular) Step 7 OUTPUT (l ij for j = 1,...,i and i = 1,...,n) OUTPUT (u ij for j = i,..., n and i = 1,...,n) STOP Numerical Analysis (Chapter 6) Matrix Factorization R L Burden & J D Faires 30 / 46

Matrix Factorization Using the LU Factorization to solve Ax = b Once the matrix factorization is complete, the solution to a linear system of the form Ax = LUx = b is found by first letting and solving for y. y = Ux Ly = b Numerical Analysis (Chapter 6) Matrix Factorization R L Burden & J D Faires 31 / 46

Matrix Factorization Using the LU Factorization (Cont d) Since L is lower triangular, we have y 1 = b 1 and, for each l 11 i = 2, 3,...,n, y i = 1 i 1 b i l ij y j l ii After y is found by this forward-substitution process, the upper-triangular system Ux = y is solved for x by backward substitution using the equations x n = y n u nn and x i = 1 u ii j=1 y i n j=i+1 u ij x j Numerical Analysis (Chapter 6) Matrix Factorization R L Burden & J D Faires 32 / 46

Outline 1 Computation Cost Rationale & Basic Solution Strategy 2 Constructing the Matrix Factorization 3 Example: LU Factorization of a 4 4 Matrix 4 The LU Factorization Algorithm 5 Permutation Matrices for Row Interchanges Numerical Analysis (Chapter 6) Matrix Factorization R L Burden & J D Faires 33 / 46

Matrix Factorization: Permutation Matrices Limitations of the LU Factorization Algorithm We assumed that Ax = b can be solved using Gaussian elimination without row interchanges. From a practical standpoint, this factorization is useful only when row interchanges are not required to control round-off error. We will now consider the modifications that must be made when row interchanges are required. Numerical Analysis (Chapter 6) Matrix Factorization R L Burden & J D Faires 34 / 46

Matrix Factorization: Permutation Matrices We begin with the introduction of a class of matrices that are used to rearrange, or permute, rows of a given matrix. Permutation Matrix An n n permutation matrix P = [p ij ] is a matrix obtained by rearranging the rows of I n, 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. Numerical Analysis (Chapter 6) Matrix Factorization R L Burden & J D Faires 35 / 46

Matrix Factorization: Permutation Matrices Example The matrix P = 1 0 0 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: PA = 1 0 0 0 0 1 0 1 0 a 11 a 12 a 13 a 21 a 22 a 23 a 31 a 32 a 33 = a 11 a 12 a 13 a 31 a 32 a 33 a 21 a 22 a 23 Similarly, multiplying A on the right by P interchanges the second and third columns of A. Numerical Analysis (Chapter 6) Matrix Factorization R L Burden & J D Faires 36 / 46

Matrix Factorization: Permutation Matrices Two useful properties of permutation matrices (1/2) Suppose k 1,...,k n is a permutation of the integers 1,...,n and the permutation matrix P = (p ij ) is defined by p ij = { 1, if j = k i 0, otherwise Numerical Analysis (Chapter 6) Matrix Factorization R L Burden & J D Faires 37 / 46

Matrix Factorization: Permutation Matrices Two useful properties of permutation matrices (2/2) Then PA permutes the rows of A; that is, a k1 1 a k1 2 a k1 n a k2 1 a k2 2 a k2 n PA =...... a kn1 a kn2 a knn P 1 exists and P 1 = P t. Numerical Analysis (Chapter 6) Matrix Factorization R L Burden & J D Faires 38 / 46

Matrix Factorization: Permutation Matrices Permutation Matrices & Gaussian Elimination Earlier, we saw that for any nonsingular matrix A, the linear system Ax = b can be solved by Gaussian elimination, with the possibility of row interchanges. If we knew the row interchanges that were required to solve the system by Gaussian elimination, we could arrange the original equations in an order that would ensure that no row interchanges are needed. Hence there is a rearrangement of the equations in the system that permits Gaussian elimination to proceed without row interchanges. Numerical Analysis (Chapter 6) Matrix Factorization R L Burden & J D Faires 39 / 46

Matrix Factorization: Permutation Matrices Permutation Matrices & Gaussian Elimination (Cont d) This implies that for any nonsingular matrix A, a permutation matrix P exists for which the system PAx = Pb can be solved without row interchanges. As a consequence, this matrix PA can be factored into PA = LU, where L is lower triangular and U is upper triangular. Because P 1 = P t, this produces the factorization A = P 1 LU = (P t L)U. The matrix U is still upper triangular, but P t L is not lower triangular unless P = I. Numerical Analysis (Chapter 6) Matrix Factorization R L Burden & J D Faires 40 / 46

Matrix Factorization: Permutation Matrices Example Determine a factorization in the form A = (P t L)U for the matrix A = 0 0 1 1 1 1 1 2 1 1 2 0 1 2 0 2 Note The matrix A cannot have an LU factorization because a 11 = 0. Numerical Analysis (Chapter 6) Matrix Factorization R L Burden & J D Faires 41 / 46

Matrix Factorization: Permutation Matrices Solution (1/4) However, using the row interchange (E 1 ) (E 2 ), followed by (E 3 + E 1 ) (E 3 ) and (E 4 E 1 ) (E 4 ), produces 1 1 1 2 0 0 1 1 0 0 1 2 0 1 1 0 Then, the row interchange (E 2 ) (E 4 ), followed by (E 4 + E 3 ) (E 4 ), gives the matrix 1 1 1 2 U = 0 1 1 0 0 0 1 2 0 0 0 3 Numerical Analysis (Chapter 6) Matrix Factorization R L Burden & J D Faires 42 / 46

Matrix Factorization: Permutation Matrices Solution (2/4) The permutation matrix associated with the row interchanges (E 1 ) (E 2 ) and (E 2 ) (E 4 ) is P = 0 1 0 0 0 0 0 1 0 0 1 0 1 0 0 0 and PA = 1 1 1 2 1 2 0 2 1 1 2 0 0 0 1 1 Numerical Analysis (Chapter 6) Matrix Factorization R L Burden & J D Faires 43 / 46

Matrix Factorization: Permutation Matrices Solution (3/4) Gaussian elimination is performed on PA using the same operations as on A, except without the row interchanges. That is, (E 2 E 1 ) (E 2 ), (E 3 + E 1 ) (E 3 ), followed by (E 4 + E 3 ) (E 4 ). The nonzero multipliers for PA are consequently, m 21 = 1, m 31 = 1, and m 43 = 1, and the LU factorization of PA is 1 0 0 0 PA = 1 1 0 0 1 0 1 0 0 0 1 1 1 1 1 2 0 1 1 0 0 0 1 2 0 0 0 3 = LU Numerical Analysis (Chapter 6) Matrix Factorization R L Burden & J D Faires 44 / 46

Matrix Factorization: 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 0 1 1 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 2 0 1 1 0 0 0 1 2 0 0 0 3 Numerical Analysis (Chapter 6) Matrix Factorization R L Burden & J D Faires 45 / 46

Questions?