GAUSSIAN ELIMINATION AND LU DECOMPOSITION (SUPPLEMENT FOR MA511)

Similar documents
22A-2 SUMMER 2014 LECTURE 5

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

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

4 Elementary matrices, continued

4 Elementary matrices, continued

Chapter 4. Solving Systems of Equations. Chapter 4

Example: 2x y + 3z = 1 5y 6z = 0 x + 4z = 7. Definition: Elementary Row Operations. Example: Type I swap rows 1 and 3

Matrix & Linear Algebra

Matrix Arithmetic. j=1

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

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

Linear Systems and Matrices

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

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

INVERSE OF A MATRIX [2.2]

Extra Problems: Chapter 1

Linear Algebra March 16, 2019

Next topics: Solving systems of linear equations

Math Linear Algebra Final Exam Review Sheet

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

. =. 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

System of Linear Equations

Section 5.6. LU and LDU Factorizations

Solving Linear Systems Using Gaussian Elimination

Topic 15 Notes Jeremy Orloff

Inverting Matrices. 1 Properties of Transpose. 2 Matrix Algebra. P. Danziger 3.2, 3.3

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 )

CS 246 Review of Linear Algebra 01/17/19

Systems of Linear Equations and Matrices

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

MTH5112 Linear Algebra I MTH5212 Applied Linear Algebra (2017/2018)

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

Linear Algebra: Lecture notes from Kolman and Hill 9th edition.

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

Row Reduced Echelon Form

Inverses and Elementary Matrices

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

Introduction to Systems of Equations

Systems of Linear Equations and Matrices

Elementary maths for GMT

Elementary Row Operations on Matrices

Chapter 2 Notes, Linear Algebra 5e Lay

Lecture 9: Elementary Matrices

Linear Equations and Matrix

MTH 464: Computational Linear Algebra

7.6 The Inverse of a Square Matrix

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

Introduction to Matrices

MAT 2037 LINEAR ALGEBRA I web:

Example: 2x y + 3z = 1 5y 6z = 0 x + 4z = 7. Definition: Elementary Row Operations. Example: Type I swap rows 1 and 3

Finite Mathematics Chapter 2. where a, b, c, d, h, and k are real numbers and neither a and b nor c and d are both zero.

MODEL ANSWERS TO THE THIRD HOMEWORK

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

a s 1.3 Matrix Multiplication. Know how to multiply two matrices and be able to write down the formula

Linear Algebra: Lecture Notes. Dr Rachel Quinlan School of Mathematics, Statistics and Applied Mathematics NUI Galway

Review of Matrices and Block Structures

POLI270 - Linear Algebra

Linear Algebra and Matrix Inversion

Gaussian Elimination -(3.1) b 1. b 2., b. b n

Matrices, Row Reduction of Matrices

Numerical Linear Algebra

Linear Algebra. Chapter Linear Equations

Inverses. Stephen Boyd. EE103 Stanford University. October 28, 2017

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

Chapter 2: Matrices and Linear Systems

Matrix Factorization Reading: Lay 2.5

Notes on Row Reduction

x + 2y + 3z = 8 x + 3y = 7 x + 2z = 3

Lectures on Linear Algebra for IT

Chapter 1 Matrices and Systems of Equations

MATH2210 Notebook 2 Spring 2018

Math 313 Chapter 1 Review

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

Final Review Sheet. B = (1, 1 + 3x, 1 + x 2 ) then 2 + 3x + 6x 2

CS227-Scientific Computing. Lecture 4: A Crash Course in Linear Algebra

LINEAR ALGEBRA WITH APPLICATIONS

Math 22AL Lab #4. 1 Objectives. 2 Header. 0.1 Notes

1300 Linear Algebra and Vector Geometry

CS123 INTRODUCTION TO COMPUTER GRAPHICS. Linear Algebra 1/33

Solving Systems of Linear Equations

Gaussian elimination

Mon Feb Matrix algebra and matrix inverses. Announcements: Warm-up Exercise:

Linear Algebra, Summer 2011, pt. 2

Linear Algebra Highlights

Chapter 2. Solving Systems of Equations. 2.1 Gaussian elimination

Lecture Notes in Linear Algebra

1 Last time: determinants

Matrices. Chapter Definitions and Notations

AMS526: Numerical Analysis I (Numerical Linear Algebra)

ORIE 6300 Mathematical Programming I August 25, Recitation 1

BASIC NOTIONS. x + y = 1 3, 3x 5y + z = A + 3B,C + 2D, DC are not defined. A + C =

Linear Algebra I Lecture 10

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

Matrix operations Linear Algebra with Computer Science Application

STAT 309: MATHEMATICAL COMPUTATIONS I FALL 2018 LECTURE 13

2.1 Gaussian Elimination

Lecture 3: Gaussian Elimination, continued. Lecture 3: Gaussian Elimination, continued

Chapter 2. Systems of Equations and Augmented Matrices. Creighton University

Transcription:

GAUSSIAN ELIMINATION AND LU DECOMPOSITION (SUPPLEMENT FOR MA511) D. ARAPURA Gaussian elimination is the go to method for all basic linear classes including this one. We go summarize the main ideas. 1. Matrix multiplication The rule for multiplying matrices is, at first glance, a little complicated. If A is m n and B is n p then C = AB is defined and of size m p with entries n c ij = a ik b kj k=1 The main reason for defining it this way will be explained when we talk about linear transformations later on. THEOREM 1.1. (1) Matrix multiplication is associative, i.e. A(BC) = (AB)C. (Henceforth, we will drop parentheses.) (2) If A is m n and I m m and I n n denote the identity matrices of the indicated sizes, AI n n = I m m A = A. (We usually just write I and the size is understood from context.) On the other hand, matrix multiplication is almost never commutative; in other words generally AB BA when both are defined. So we have to be careful not to inadvertently use it in a calculation. Given an n n matrix A, the inverse, if it exists, is another n n matrix A 1 such that AA I = I, A 1 A = I A matrix is called invertible or nonsingular if A 1 exists. In practice, it is only necessary to check one of these. THEOREM 1.2. If B is n n and AB = I or BA = I, then A invertible and B = A 1. Proof. The proof of invertibility of A will need to wait until we talk about determinants. Assuming this and AB = I. Multiply both sides on the left by A 1 to get which simplifies to A 1 AB = A 1 I IB = A 1 or B = A 1. If BA = I the argument is similar. 1

2 D. ARAPURA 2. Elementary row operations Given a matrix A, we can try to simplify it by preforming 3 types of elementary row operations: I Add a multiple of one row to another. II Interchange two rows III Multiply a row by a nonzero number. A matrix is elementary if can be obtained from the identity by a single elementary row operation. THEOREM 2.1. If A is an n m matrix and E and elementary n n matrix, then EA is the same thing as doing the corresponding elementary row operation on A. Rather than giving a detailed proof, let us consider a few examples ( ) ( ) ( ) ( ) 1 0 0 1 x 0 a b E 1 =, E x 1 2 =, E 1 0 3 =, A = 0 1 c d Then we can see by multiplying ( ) ( ) ( ) a b c d xa xb E 1 A =, E c + xa d + xb 2 A =, E a b 3 A =, c d that this is exactly what the theorem says. QUESTION 2.2. What happens if we multiply the other way AE? Another important fact is: THEOREM 2.3. An elementary matrix is invertible (or nonsingular). Proof. We have to check this for each of the three types. We just treat type I. given an elementary matrix E, corresponding to adding x times row i to row j, E 1 is the elementary matrix corresponding to adding x times row i to row j. (3.1) 3. Gaussian elimination A matrix is in reduced row echelon form (RREF for short) if it looks like 1 0... 0 0 1... 0 0 0... More precisely, (1) The first nonzero entry of a row (called a pivot) is 1. (2) A pivot is the only nonzero entry in its column. (3) Rows of 0 s have to be at the bottom of the matrix. THEOREM 3.1 (Gaussian Elimination). Any matrix A can be taken to a reduced row echelon matrix B by a finite sequence of elementary row operations. Furthermore, B depends only on A and not on the specific sequence of operations. Note that the statement is not true if B only in echelon form. Proof. To prove that B exists, we just have to describe the algorithm and prove that it works. We do this in informal terms:

GAUSSIAN ELIMINATION AND LU DECOMPOSITION (SUPPLEMENT FOR MA511) 3 (1) We ll use a pointer, which is really a pair of integers to tell us what entry of A we re looking at as the algorithm progresses. We ll refer to this location (entry, row or column) as the current location. Initially, set the pointer to (1, 1). (2) If the current entry of A (e.g. a 11 ) is zero switch the current row with the first row below it with a nonzero entry in the current column. If no such row exists, advance the pointer by (1, 1) and repeat the algorithm from step 2. (3) Multiply current row by a constant so that it leads with 1. (4) Subtract multiples of the current row from rows above and below it to clear the current column. (5) Advance the pointer by (1, 1), if possible, then repeat from step 2, otherwise stop. The proof that the algorithm is correct can be done by mathematical induction, but we won t go into details. Next, we have to prove that if we have two sequences of elementary matrices E 1,..., E N and E 1,..., E M such that B = E N... E 1 A and B = E M... E 1A are both in RREF, then B = B. Note that B = CB where C = E M... E 1E 1 1... E 1 N Suppose that B is as in (3.1), then c 11 c 11 0... CB = 0 0 c 22... 0 0 0... The only way this is in RREF is if c 11 = 1, c 22 = 1 etc. This forces B = B. The last part of the theorem says that B is really a function of A. software, such as MATLAB, will compute this. A lot of 4. Solving equations The original raison d etre for linear algebra is to understand solutions of systems of linear equations. In matrix form, we are given a matrix A and a column vector B, then we want to find all column vectors X such that (4.1) AX = B The easiest strategy is to form the augmented matrix [A B]. The notation means append B as the last column of A. Take it to RREF, or just to some intermediate stage that s simpler than the original. Then solve the new simpler system. The obvious question is why is this the same as solving the original system? To answer this, list the elementary matrices E 1,..., E N corresponding the operations used in the order they appear. Set C = E N... E 1. Then the new system is (4.2) CAX = CB THEOREM 4.1. The systems (4.1) and (4.2) have the same solutions. Proof. Suppose that X is solution of (4.2). Then multiplying both sides by C 1 on the left and simplifying shows that X also satisfies (4.1). Multiplying (4.1) on the left by C shows the converse.

4 D. ARAPURA Suppose A is n n, is invertible and we happen to know what A 1 is, then the solution to (4.1) is simply X = A 1 B So how to we find A 1? The algorithm, called Gauss-Jordan elimination goes as follows: (1) Form [A I] (2) Do elementary row operations to get it to [L R], such that L is in RREF. (3) There are two possibilities either L is I or it has a row of zeros. In the first case, R = A 1. In the second case, A 1 does not exist. To show this works, we need THEOREM 4.2. (1) Suppose that E 1,..., E N are elementary matrices such that E N... E 1 [A I] = [I R] Then R = A 1. (2) Suppose that E 1,..., E N are elementary matrices such that E N... E 1 [A I] = [L R] where C has a row of zeros, then A is not invertible. Proof. In case (1), we can see that E N... E 1 [A I] = [E N... E 1 A E N... E 1 I] Comparing this to what we are given, we obtain E N... E 1 A = I E N... E 1 I = R From theorem 1.2 A 1 = E N... E 1 This is R by the second equation. The proof of (2) will be given later on 5. LU decomposition A square matrix is called upper (respectively lower) triangular if all entries below (resp. above) the diagonal are zero. A triangular matrix will be called a unit triangular matrix if it has 1 s on the diagonal. Instead of taking a square matrix all the way to RREF, it is simpler, and often just as useful, to take it to upper triangular form. For example, solving the systen AX = B when A is upper triangular is easy. Start with the last equation, a nn x n = b n this tells the value for x n assuming the coefficient is nonzero. Then back substitute into the second to last a n 1,n 1 x n 1 + a n 1,n x n = b n 1 to find x n 1 etc. We can summarize this by the following

GAUSSIAN ELIMINATION AND LU DECOMPOSITION (SUPPLEMENT FOR MA511) 5 THEOREM 5.1. If A is upper triangular with no zeros on the diagonal, the solution to the previous equation is given by (5.1) x n = b n a nn x n 1 = b n 1 a n 1,n x n a n 1,n 1... Furthermore A 1 exists and is again upper triangular. Proof. The first part follows from we said above. To prove the statement about the inverse, we apply the first part to where B are the columns of the identity. If B = (0... 0, 1, 0...) T is the ith column of I, then solution of AX = B gives the ith column of A 1. The formulas (5.1) show that x n =... x i+1 = 0 This says that entries below the diagonal are zero. COROLLARY 5.2. A lower triangular matrix A with nonzero diagonals is invertible, and A 1 is lower triangular. Proof. If A T is upper triangular so (A T ) 1 is upper triangular. One can check that this is the same thing as (A 1 ) T. Therefore A 1 is lower triangular. It is clear we can take A to an upper triangular matrix by elementary row operations. In good cases, we use only operations of type I, where we add a multiple of one row to a row below it. This means that we can find a sequence of elementary matrices E i which are unit lower triangular such that E N... E 1 A = U where U is upper triangular. Setting L = E1 1... E 1 N, we see that it is unit lower triangular. Therefore A = LU is a product of a unit lower triangular matrix with an upper triangular matrix. If such a factorization is possible, then we say that A admits an LU decomposition. Unfortunately, it is not always possible. For instance, ( ) 0 1 1 1 does not admit an LU factorization. In this case, we can fix the problem by switching rows. A matrix is called a permutation matrix if is obtained from the identity by permuting rows, or equivalently by a sequence of elementary operations of type II. THEOREM 5.3. Most invertible matrices admit a unique LU decomposition. If A admits an LU decomposition, then L and U are unique. Given an invertible A, there exists a permutation matrix P such that P A admits an LU decomposition.

6 D. ARAPURA Most is not a precise mathematical term. The actual statement is that the set of invertible matrices admitting LU decompositions is dense in the set of all invertible matrices. Intuitively this means that given any matrix a small perturbation of coefficients will yield one admitting such a decomposition. Proof. We give a proof in the 2 2 case. We do this directly rather than using Gaussian elimination.we have to solve ( ) ( ) ( ) 1 0 u11 u 12 a11 a = 12 l 21 1 0 u 22 a 21 a 22 or u 11 = a 11 u 12 = a 12 l 21 u 11 = a 21 l 21 u 12 + u 22 = a 22 This is very easy to solve. The first two equations give us the values for u 11, u 12, and l 12 = a 21 u 11 u 22 = a 22 l 12 u 12 gives the remaining variables. If a 11 = 0 then these solutions won t be valid. In this case, we choose P in advance to switch the rows. Given as above, we can find the inverse P A = LU A 1 = U 1 L 1 P easily. The obvious question is why bother with this since we already have a method for computing the inverse? The answer is that Gauss-Jordan is good for hand computation, but not as good for implementing on a computer. In this case, we need an algorithm which is both efficient and numerically stable in the sense that we can control round off errors. In classic Gaussian elimination, you might divide by a very small number, which can magnify the round-off error. This is a big topic, and we won t have much more to say about it in the future.