Section Partitioned Matrices and LU Factorization

Similar documents
MTH 215: Introduction to Linear Algebra

Fall Inverse of a matrix. Institute: UC San Diego. Authors: Alexander Knop

MATH2210 Notebook 2 Spring 2018

Solving Ax = b w/ different b s: LU-Factorization

Math 344 Lecture # Linear Systems

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

Matrix Factorization Reading: Lay 2.5

2.1 Gaussian Elimination

MATH 2030: ASSIGNMENT 4 SOLUTIONS

MTH 464: Computational Linear Algebra

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

Eigenvalues and Eigenvectors

30.3. LU Decomposition. Introduction. Prerequisites. Learning Outcomes

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

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

Eigenvalues and Eigenvectors

Next topics: Solving systems of linear equations

Elementary matrices, continued. To summarize, we have identified 3 types of row operations and their corresponding

MATH 323 Linear Algebra Lecture 6: Matrix algebra (continued). Determinants.

MATH 2331 Linear Algebra. Section 2.1 Matrix Operations. Definition: A : m n, B : n p. Example: Compute AB, if possible.

MA 511, Session 10. The Four Fundamental Subspaces of a Matrix

Determinants Chapter 3 of Lay

MTH501- Linear Algebra MCQS MIDTERM EXAMINATION ~ LIBRIANSMINE ~

Matrix operations Linear Algebra with Computer Science Application

4 Elementary matrices, continued

Graduate Mathematical Economics Lecture 1

Undergraduate Mathematical Economics Lecture 1

System of Linear Equations

Elementary Row Operations on Matrices

MAC1105-College Algebra. Chapter 5-Systems of Equations & Matrices

Introduction to Determinants

Necessary And Sufficient Conditions For Existence of the LU Factorization of an Arbitrary Matrix.

GAUSSIAN ELIMINATION AND LU DECOMPOSITION (SUPPLEMENT FOR MA511)

forms Christopher Engström November 14, 2014 MAA704: Matrix factorization and canonical forms Matrix properties Matrix factorization Canonical forms

ANALYTICAL MATHEMATICS FOR APPLICATIONS 2018 LECTURE NOTES 3

Math 3C Lecture 20. John Douglas Moore

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

Section 5.6. LU and LDU Factorizations

Chapter 4. Determinants

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

MTH 464: Computational Linear Algebra

CSL361 Problem set 4: Basic linear algebra

Chapter 3. Determinants and Eigenvalues

MIDTERM 1 - SOLUTIONS

Determinants by Cofactor Expansion (III)

4. Determinants.

Math "Matrix Approach to Solving Systems" Bibiana Lopez. November Crafton Hills College. (CHC) 6.3 November / 25

The Solution of Linear Systems AX = B

AMS526: Numerical Analysis I (Numerical Linear Algebra)

Scientific Computing

4 Elementary matrices, continued

Gaussian Elimination and Back Substitution

Department of Aerospace Engineering AE602 Mathematics for Aerospace Engineers Assignment No. 4

Lecture 22: Section 4.7

Review for Exam Find all a for which the following linear system has no solutions, one solution, and infinitely many solutions.

Determinants: summary of main results

Remark By definition, an eigenvector must be a nonzero vector, but eigenvalue could be zero.

Chapter 2:Determinants. Section 2.1: Determinants by cofactor expansion

MODEL ANSWERS TO THE THIRD HOMEWORK

Kevin James. MTHSC 3110 Section 2.2 Inverses of Matrices

MAT 343 Laboratory 3 The LU factorization

3.4 Elementary Matrices and Matrix Inverse

Math 313 Chapter 1 Review

Matrix Arithmetic. j=1

Introduction. Vectors and Matrices. Vectors [1] Vectors [2]

Extra Problems: Chapter 1

Components and change of basis

Fundamentals of Engineering Analysis (650163)

Math 4377/6308 Advanced Linear Algebra

Math 3191 Applied Linear Algebra

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

MATH 2030: MATRICES. Example 0.2. Q:Define A 1 =, A. 3 4 A: We wish to find c 1, c 2, and c 3 such that. c 1 + c c

Topics. Vectors (column matrices): Vector addition and scalar multiplication The matrix of a linear function y Ax The elements of a matrix A : A ij

Matrices: 2.1 Operations with Matrices

Math 1553 Introduction to Linear Algebra

Lectures on Linear Algebra for IT

Phys 201. Matrices and Determinants

Evaluating Determinants by Row Reduction

Math 18, Linear Algebra, Lecture C00, Spring 2017 Review and Practice Problems for Final Exam

Chapter 2. Square matrices

Matrix decompositions

LINEAR ALGEBRA SUMMARY SHEET.

Matrix Algebra & Elementary Matrices

Section 12.4 Algebra of Matrices

5x 2 = 10. x 1 + 7(2) = 4. x 1 3x 2 = 4. 3x 1 + 9x 2 = 8

A FIRST COURSE IN LINEAR ALGEBRA. An Open Text by Ken Kuttler. Matrix Arithmetic

is a 3 4 matrix. It has 3 rows and 4 columns. The first row is the horizontal row [ ]

n n matrices The system of m linear equations in n variables x 1, x 2,..., x n can be written as a matrix equation by Ax = b, or in full

Chapter 4 - MATRIX ALGEBRA. ... a 2j... a 2n. a i1 a i2... a ij... a in

Numerical Linear Algebra

Math 103, Summer 2006 Determinants July 25, 2006 DETERMINANTS. 1. Some Motivation

Matrix Operations. Linear Combination Vector Algebra Angle Between Vectors Projections and Reflections Equality of matrices, Augmented Matrix

Elementary Matrices. MATH 322, Linear Algebra I. J. Robert Buchanan. Spring Department of Mathematics

Remark 1 By definition, an eigenvector must be a nonzero vector, but eigenvalue could be zero.

Lecture 6 & 7. Shuanglin Shao. September 16th and 18th, 2013

Section 2.2: The Inverse of a Matrix

12/1/2015 LINEAR ALGEBRA PRE-MID ASSIGNMENT ASSIGNED BY: PROF. SULEMAN SUBMITTED BY: M. REHAN ASGHAR BSSE 4 ROLL NO: 15126

We could express the left side as a sum of vectors and obtain the Vector Form of a Linear System: a 12 a x n. a m2

MATRICES. knowledge on matrices Knowledge on matrix operations. Matrix as a tool of solving linear equations with two or three unknowns.

Formula for the inverse matrix. Cramer s rule. Review: 3 3 determinants can be computed expanding by any row or column

Transcription:

Section 2.4 2.5 Partitioned Matrices and LU Factorization Gexin Yu gyu@wm.edu College of William and Mary

partition matrices into blocks In real world problems, systems can have huge numbers of equations and un-knowns. Standard computation techniques are inefficient in such cases, so we need to develop techniques which exploit the internal structure of the matrices. In most cases, the matrices of interest have lots of zeros.

partition matrices into blocks In real world problems, systems can have huge numbers of equations and un-knowns. Standard computation techniques are inefficient in such cases, so we need to develop techniques which exploit the internal structure of the matrices. In most cases, the matrices of interest have lots of zeros. One approach to simplify the computation is to partition a matrix into blocks.

partition matrices into blocks In real world problems, systems can have huge numbers of equations and un-knowns. Standard computation techniques are inefficient in such cases, so we need to develop techniques which exploit the internal structure of the matrices. In most cases, the matrices of interest have lots of zeros. One approach to simplify the computation is to partition a matrix into blocks. 3 0 1 5 9 2 Ex: A = 5 2 4 0 3 1. 8 6 3 1 7 4

partition matrices into blocks In real world problems, systems can have huge numbers of equations and un-knowns. Standard computation techniques are inefficient in such cases, so we need to develop techniques which exploit the internal structure of the matrices. In most cases, the matrices of interest have lots of zeros. One approach to simplify the computation is to partition a matrix into blocks. 3 0 1 5 9 2 Ex: A = 5 2 4 0 3 1. 8 6 3 1 7 4 This partition can also be written as the following 2 3 block matrix: [ ] A11 A A = 12 A 13 A 21 A 22 A 23

partition matrices into blocks In real world problems, systems can have huge numbers of equations and un-knowns. Standard computation techniques are inefficient in such cases, so we need to develop techniques which exploit the internal structure of the matrices. In most cases, the matrices of interest have lots of zeros. One approach to simplify the computation is to partition a matrix into blocks. 3 0 1 5 9 2 Ex: A = 5 2 4 0 3 1. 8 6 3 1 7 4 This partition can also be written as the following 2 3 block matrix: [ ] A11 A A = 12 A 13 A 21 A 22 A 23 In the block form, we have blocks A 11 = [ 3 0 ] 1 5 2 4 and so on.

Operations on partitioned matrices (Addition and scalar multiplication) IF matrices A and B are the same size and are partitioned in exactly the same way, namely A = (A ij ) and B = (B ij ), then A + B = (A ij + B ij ), and ra = (ra ij )

Operations on partitioned matrices (Addition and scalar multiplication) IF matrices A and B are the same size and are partitioned in exactly the same way, namely A = (A ij ) and B = (B ij ), then A + B = (A ij + B ij ), and ra = (ra ij ) (multiplication) If the partitions of A and B are comfortable for block multiplication, namely, the column partition of A matches the row partition of B, then if A = (A ij ) m n and B = (B ij ) n p, then AB = (C ij ) m p, where C ij = A i1 B ij + A i2 B 2j +... + A in B nj

Example Find AB, where A = 2 3 1 0 4 1 5 2 3 1 0 4 2 7 1 [ A11 A = 12 A 21 A 22 ], B = 6 4 2 1 3 7 1 3 = 5 2 [ B1 B 2 ]

Example Find AB, where A = 2 3 1 0 4 1 5 2 3 1 0 4 2 7 1 [ A11 A = 12 A 21 A 22 ], B = 6 4 2 1 3 7 1 3 = 5 2 [ B1 B 2 ] Soln: [ ] [ ] [ ] A11 A AB = 12 B1 A11 B = 1 + A 12 B 2 A 21 A 22 B 2 A 21 B 1 + A 22 B 2 5 4 = 6 2 2 1

Example [ ] [ ] A O C I Compute, where A, B, C and D are n n, O is the I B O D n n zero matrix, and I is the n n identity matrix.

Example Soln: [ ] [ ] A O C I Compute, where A, B, C and D are n n, O is the I B O D n n zero matrix, and I is the n n identity matrix. [ ] [ ] [ ] [ ] A O C I AC AI AC A = = I B O D IC II + BD C I + BD

Example [ ] [ ] A O C I Compute, where A, B, C and D are n n, O is the I B O D n n zero matrix, and I is the n n identity matrix. [ ] [ ] [ ] [ ] A O C I AC AI AC A Soln: = = I B O D IC II + BD C I + BD If we do direct multiplication: to compute each term uses 2n multiplications and 2n additions, or 4n flops (floating point operations). Since there are 4n 2 terms in the resulting matrix, direct multiplication uses 4n 4n 2 = 16n 3 flops.

Example [ ] [ ] A O C I Compute, where A, B, C and D are n n, O is the I B O D n n zero matrix, and I is the n n identity matrix. [ ] [ ] [ ] [ ] A O C I AC AI AC A Soln: = = I B O D IC II + BD C I + BD If we do direct multiplication: to compute each term uses 2n multiplications and 2n additions, or 4n flops (floating point operations). Since there are 4n 2 terms in the resulting matrix, direct multiplication uses 4n 4n 2 = 16n 3 flops. In the above computation, to compute AC takes 2n n 2 flops, to compute BD takes 2n n 2 flops, to add I + BD takes n flops, so partitioned multiplication uses 4n 3 + n? flops.

Example [ ] [ ] A O C I Compute, where A, B, C and D are n n, O is the I B O D n n zero matrix, and I is the n n identity matrix. [ ] [ ] [ ] [ ] A O C I AC AI AC A Soln: = = I B O D IC II + BD C I + BD If we do direct multiplication: to compute each term uses 2n multiplications and 2n additions, or 4n flops (floating point operations). Since there are 4n 2 terms in the resulting matrix, direct multiplication uses 4n 4n 2 = 16n 3 flops. In the above computation, to compute AC takes 2n n 2 flops, to compute BD takes 2n n 2 flops, to add I + BD takes n flops, so partitioned multiplication uses 4n 3 + n? flops. Take n = 1000. How many steps do we save?

Inverse of Partitioned Matrices [ ] A11 A A matrix of the form 12 is said to be block upper triangular. 0 A 22 Assume that A 11 is p p, A 22 is q q, and A is invertible. Find a formula for A 1.

Inverse of Partitioned Matrices [ ] A11 A A matrix of the form 12 is said to be block upper triangular. 0 A 22 Assume that A 11 is p p, A 22 is q q, and A is invertible. Find a formula for A 1. Soln: Let A 1 be B and partition B so that [ ] [ ] [ ] A11 A 12 B11 B 12 Ip 0 = 0 A 22 B 21 B 22 0 I q

Inverse of Partitioned Matrices [ ] A11 A A matrix of the form 12 is said to be block upper triangular. 0 A 22 Assume that A 11 is p p, A 22 is q q, and A is invertible. Find a formula for A 1. Soln: Let A 1 be B and partition B so that [ ] [ ] [ ] A11 A 12 B11 B 12 Ip 0 = 0 A 22 B 21 B 22 0 I q So we will have A 11 B 11 + A 12 B 21 = I p (1) A 11 B 12 + A 12 B 22 = 0 (2) A 22 B 21 = 0 (3) A 22 B 22 = I q (4)

As A is invertible, A 22 must be invertible. So from (??), we get B 22 = A 1 22, and from (??), we have B 21 = 0.

As A is invertible, A 22 must be invertible. So from (??), we get B 22 = A 1 22, and from (??), we have B 21 = 0. As A is invertible, A 11 must be invertible. So from (??) and B 21 = 0, we get B 11 = A 1 11.

As A is invertible, A 22 must be invertible. So from (??), we get B 22 = A 1 22, and from (??), we have B 21 = 0. As A is invertible, A 11 must be invertible. So from (??) and B 21 = 0, we get B 11 = A 1 11. From (??), we get A 11 B 12 = A 12 B 22 = A 12 A 1 22. So B 12 = A 1 11 A 12A 1 22.

As A is invertible, A 22 must be invertible. So from (??), we get B 22 = A 1 22, and from (??), we have B 21 = 0. As A is invertible, A 11 must be invertible. So from (??) and B 21 = 0, we get B 11 = A 1 11. From (??), we get A 11 B 12 = A 12 B 22 = A 12 A 1 22. So B 12 = A 1 11 A 12A 1 22. So [ ] 1 A 1 A11 A = 12 = 0 A 22 [ A 1 11 A 1 11 A 12A 1 ] 22 0 A 1 22

As A is invertible, A 22 must be invertible. So from (??), we get B 22 = A 1 22, and from (??), we have B 21 = 0. As A is invertible, A 11 must be invertible. So from (??) and B 21 = 0, we get B 11 = A 1 11. From (??), we get A 11 B 12 = A 12 B 22 = A 12 A 1 22. So B 12 = A 1 11 A 12A 1 22. So [ ] 1 A 1 A11 A = 12 = 0 A 22 [ A 1 11 A 1 11 A 12A 1 ] 22 0 A 1 22 A block diagonal matrix is a partitioned matrix with zero blocks off the main diagonal (of blocks). From the above example, such a matrix is invertible if and only if each block on the diagonal is invertible.

Example: find the inverse of the following matrix 1 2 0 0 0 1 2 0 0 0 0 0 3 0 0 0 0 0 3 2 0 0 0 1 2

LU Factorization An LU-factorization of an m n matrix A is an equation that expresses A as a product of an m m lower triangular matrix and an m n upper triangular matrix.

LU Factorization An LU-factorization of an m n matrix A is an equation that expresses A as a product of an m m lower triangular matrix and an m n upper triangular matrix. In particular, if A can be row reduced to echelon form without row interchanges, then we could make the main diagonal of L to be 1s. Or 1 0 0 0... 0 u 11 u 12 u 13... u 1n l 21 1 0 0... 0 0 u 22 u 23... u 2n A = LU = l 31 l 32 1 0... 0... l m1 l m2 l m3...... 1 0 0 u 33... u 3n... 0 0 0... 0 u nm

Motivation for LU Factorization If we want to solve the matrix equation Ax = b and we have LU-factorization of A = LU, then we can the following: Ax = LUx = L(Ux) = b so let y = Ux, we have Ly = b. Solve Ly = b to get y. Sove Ux = y to get x.

An LU factorization algorithm Suppose that A can be reduced to an echelon form U using only row replacements that add a multiple of one row to another row below it.

An LU factorization algorithm Suppose that A can be reduced to an echelon form U using only row replacements that add a multiple of one row to another row below it. So there are unit lower triangular elementary matrices E 1, E 2,..., E p such that E p... E 1 A = U

An LU factorization algorithm Suppose that A can be reduced to an echelon form U using only row replacements that add a multiple of one row to another row below it. So there are unit lower triangular elementary matrices E 1, E 2,..., E p such that E p... E 1 A = U Then A = (E p... E 1 ) 1 U = LU, with L = (E p... E 1 ) 1 = E1 1... Ep 1

An LU factorization algorithm Suppose that A can be reduced to an echelon form U using only row replacements that add a multiple of one row to another row below it. So there are unit lower triangular elementary matrices E 1, E 2,..., E p such that E p... E 1 A = U Then A = (E p... E 1 ) 1 U = LU, with L = (E p... E 1 ) 1 = E1 1... Ep 1 The above argument suggests the following algorithm to find an LU factorization of A:

An LU factorization algorithm Suppose that A can be reduced to an echelon form U using only row replacements that add a multiple of one row to another row below it. So there are unit lower triangular elementary matrices E 1, E 2,..., E p such that E p... E 1 A = U Then A = (E p... E 1 ) 1 U = LU, with L = (E p... E 1 ) 1 = E1 1... Ep 1 The above argument suggests the following algorithm to find an LU factorization of A: 1 Use row operations to reduce A to an upper triangles, and record the elementary matrices E 1, E 2,..., E p.

An LU factorization algorithm Suppose that A can be reduced to an echelon form U using only row replacements that add a multiple of one row to another row below it. So there are unit lower triangular elementary matrices E 1, E 2,..., E p such that E p... E 1 A = U Then A = (E p... E 1 ) 1 U = LU, with L = (E p... E 1 ) 1 = E1 1... Ep 1 The above argument suggests the following algorithm to find an LU factorization of A: 1 Use row operations to reduce A to an upper triangles, and record the elementary matrices E 1, E 2,..., E p. 2 Then L = E 1 1... Ep 1. Or I = E 1... E p L.

Example 2 4 1 5 2 Ex. Find an LU factorization of A = 4 5 3 8 1 2 5 4 1 8. 6 0 7 3 1

Example 2 4 1 5 2 Ex. Find an LU factorization of A = 4 5 3 8 1 2 5 4 1 8. 6 0 7 3 1 We first reduce A to an upper triangular form by row operations, and record each step with an elementary matrix. 2 4 1 5 2 A 0 3 1 2 3 0 9 3 4 10 = A 1 (5) 0 12 4 12 5 2 4 1 5 2 2 4 1 5 2 0 3 1 2 3 0 0 0 2 1 0 3 1 2 3 0 0 0 2 1 = U (6) 0 0 0 4 7 0 0 0 0 5

In the first step, we used row operations R2 + 2R1, R3 R1, R4 + 3R1, which corresponds to elementary matrices 1 0 0 0 1 0 0 0 1 0 0 0 E 1 = 2 1 0 0 0 0 1 0, E 2 = 0 1 0 0 1 0 1 0, E 3 = 0 1 0 0 0 0 1 0. 0 0 0 1 0 0 0 1 3 0 0 1

In the first step, we used row operations R2 + 2R1, R3 R1, R4 + 3R1, which corresponds to elementary matrices 1 0 0 0 1 0 0 0 1 0 0 0 E 1 = 2 1 0 0 0 0 1 0, E 2 = 0 1 0 0 1 0 1 0, E 3 = 0 1 0 0 0 0 1 0. 0 0 0 1 0 0 0 1 3 0 0 1 In the second step, we used row operations R3 + 3R2, R4 4R2, which corresponds to elementary matrices 1 0 0 0 1 0 0 0 E 4 = 0 1 0 0 0 3 1 0, E 5 = 0 1 0 0 0 0 1 0 0 0 0 1 0 4 0 1

In the first step, we used row operations R2 + 2R1, R3 R1, R4 + 3R1, which corresponds to elementary matrices 1 0 0 0 1 0 0 0 1 0 0 0 E 1 = 2 1 0 0 0 0 1 0, E 2 = 0 1 0 0 1 0 1 0, E 3 = 0 1 0 0 0 0 1 0. 0 0 0 1 0 0 0 1 3 0 0 1 In the second step, we used row operations R3 + 3R2, R4 4R2, which corresponds to elementary matrices 1 0 0 0 1 0 0 0 E 4 = 0 1 0 0 0 3 1 0, E 5 = 0 1 0 0 0 0 1 0 0 0 0 1 0 4 0 1 In the last step, the row operation is R4 2R3, and the 1 0 0 0 corresponding elementary matrix is E 6 = 0 1 0 0 0 0 1 0, 0 0 2 1

One important observation (the position of d could be anywhere): 1 0 0 0 1 0 0 0 if E = d 1 0 0 0 0 1 0, then E 1 = d 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1

One important observation (the position of d could be anywhere): 1 0 0 0 1 0 0 0 if E = d 1 0 0 0 0 1 0, then E 1 = d 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 So (pay attend to the result) 1 0 0 0 L 1 = E1 1 E 2 1 E 3 1 I = 2 1 0 0 1 0 1 0 3 0 0 1

One important observation (the position of d could be anywhere): 1 0 0 0 1 0 0 0 if E = d 1 0 0 0 0 1 0, then E 1 = d 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 So (pay attend to the result) 1 0 0 0 L 1 = E1 1 E 2 1 E 3 1 I = 2 1 0 0 1 0 1 0 3 0 0 1 Thus 1 0 0 0 L = L 1 E4 1 E 5 1 E 6 1 = 2 1 0 0 1 3 1 0 3 4 2 1