MTH 464: Computational Linear Algebra

Similar documents
MTH 464: Computational Linear Algebra

MTH 464: Computational Linear Algebra

Chapter 2 Notes, Linear Algebra 5e Lay

MATH2210 Notebook 2 Spring 2018

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

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

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

Linear equations in linear algebra

MATH 2331 Linear Algebra. Section 1.1 Systems of Linear Equations. Finding the solution to a set of two equations in two variables: Example 1: Solve:

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

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

MTH501- Linear Algebra MCQS MIDTERM EXAMINATION ~ LIBRIANSMINE ~

Review Questions REVIEW QUESTIONS 71

Math 1553 Introduction to Linear Algebra

Linear Algebra and Matrix Inversion

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

Linear Algebra March 16, 2019

ORIE 6300 Mathematical Programming I August 25, Recitation 1

Elementary maths for GMT

Matrices and systems of linear equations

Scientific Computing: Dense Linear Systems

Linear Algebra Exam 1 Spring 2007

A Review of Matrix Analysis

Elementary Row Operations on Matrices

Math 4A Notes. Written by Victoria Kala Last updated June 11, 2017

Matrix operations Linear Algebra with Computer Science Application

Online Exercises for Linear Algebra XM511

7.6 The Inverse of a Square Matrix

ANALYTICAL MATHEMATICS FOR APPLICATIONS 2018 LECTURE NOTES 3

Equality: Two matrices A and B are equal, i.e., A = B if A and B have the same order and the entries of A and B are the same.

Math Camp II. Basic Linear Algebra. Yiqing Xu. Aug 26, 2014 MIT

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

GAUSSIAN ELIMINATION AND LU DECOMPOSITION (SUPPLEMENT FOR MA511)

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

Mon Feb Matrix inverses, the elementary matrix approach overview of skipped section 2.5. Announcements: Warm-up Exercise:

Gaussian Elimination and Back Substitution

MAT 2037 LINEAR ALGEBRA I web:

Section Gaussian Elimination

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

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

Linear Equations in Linear Algebra

INVERSE OF A MATRIX [2.2]

Math 3191 Applied Linear Algebra

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

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

Review Let A, B, and C be matrices of the same size, and let r and s be scalars. Then

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

MODEL ANSWERS TO THE THIRD HOMEWORK

Linear Algebra review Powers of a diagonalizable matrix Spectral decomposition

2.1 Gaussian Elimination

Fundamentals of Engineering Analysis (650163)

Matrix & Linear Algebra

22A-2 SUMMER 2014 LECTURE 5

MATH 3511 Lecture 1. Solving Linear Systems 1

Definition 2.3. We define addition and multiplication of matrices as follows.

Linear Algebra review Powers of a diagonalizable matrix Spectral decomposition

Lectures on Linear Algebra for IT

Chapter 1: Systems of Linear Equations

Chapter 7. Linear Algebra: Matrices, Vectors,

Math 313 Chapter 1 Review

Components and change of basis

Vectors and matrices: matrices (Version 2) This is a very brief summary of my lecture notes.

Practical Linear Algebra: A Geometry Toolbox

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

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

Linear Algebra I Lecture 8

CHAPTER 6. Direct Methods for Solving Linear Systems

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

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

System of Linear Equations

MATH10212 Linear Algebra B Homework Week 4

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

MATH 315 Linear Algebra Homework #1 Assigned: August 20, 2018

Linear Algebra. Matrices Operations. Consider, for example, a system of equations such as x + 2y z + 4w = 0, 3x 4y + 2z 6w = 0, x 3y 2z + w = 0.

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

Linear Algebra. The analysis of many models in the social sciences reduces to the study of systems of equations.

Numerical Linear Algebra

MTH 215: Introduction to Linear Algebra

Lecture Notes in Linear Algebra

Midterm 1 Review. Written by Victoria Kala SH 6432u Office Hours: R 12:30 1:30 pm Last updated 10/10/2015

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

Direct Methods for Solving Linear Systems. Matrix Factorization

Next topics: Solving systems of linear equations

Math 344 Lecture # Linear Systems

Math Linear Algebra Final Exam Review Sheet

Multiplying matrices by diagonal matrices is faster than usual matrix multiplication.

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 )

LS.1 Review of Linear Algebra

The Solution of Linear Systems AX = B

Numerical Linear Algebra

Math 102, Winter Final Exam Review. Chapter 1. Matrices and Gaussian Elimination

Graduate Mathematical Economics Lecture 1

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

1 - Systems of Linear Equations

Linear Algebra Summary. Based on Linear Algebra and its applications by David C. Lay

Math 240 Calculus III

Chapter 1. Vectors, Matrices, and Linear Spaces

Linear Algebra Highlights

Math 60. Rumbos Spring Solutions to Assignment #17

The matrix will only be consistent if the last entry of row three is 0, meaning 2b 3 + b 2 b 1 = 0.

Transcription:

MTH 464: Computational Linear Algebra Lecture Outlines Exam 2 Material Prof. M. Beauregard Department of Mathematics & Statistics Stephen F. Austin State University February 6, 2018 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 1 / 88 Contents I 1 Lecture 1 2 Lecture 2 3 Lecture 3 4 Lecture 4 5 Lecture 5 6 Lecture 6 7 Lecture 7 8 Lecture 8 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 2 / 88

Lecture 1 Overview Goal for today: Understand what a linear transformation is [section 1.8] Outline: 1 Matrix Transformations 2 Linear Transformations Assignment (1.8): Read: section 1.9 Work: section 1.8 (p. 69) #1, 3, 4, 7, 8, 10, 11, 17, 24 Extra practice: #5, 13, 15, 21-23 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 3 / 88 Lecture 1 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 4 / 88

Lecture 1 Linear Independence (review) Recall: A set of vectors { v 1,..., v p } is linearly independent iff: (definition, page 57) The vector equation x 1 v 1 + + x p v p = 0 has only the trivial solution x 1 = 0,..., x p = 0 (box, page 58) With A = [ v 1... v p ] : the matrix equation Ax = 0 has only the trivial solution x = 0 Equivalently: A set of vectors { v 1,..., v p } is linearly dependent iff: (Theorem 7, page 59) At least one of the vectors is a linear combination of the others. Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 5 / 88 Lecture 1 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 6 / 88

Matrix Transformations Notation Let A and B be sets. Lecture 1 f : A B means that f is a function from A (called its domain) into B (called its codomain). The range of the function f is the set of images (outputs) under f (this is a subset of B, but not necessarily all of B). Definition (page 64) For an m n matrix A, the associated matrix transformation is the function T : R n R m defined by the rule left-multiply by A : T (x) = Ax for all vectors x in R n Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 7 / 88 Lecture 1 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 8 / 88

Linear Transformations Definition (page 66) Lecture 1 A function T : R n R m is a linear transformation if and only if it preserves addition and scalar multiplication: T (u + v) = T (u) + T (v) for all vectors u, v in R n T (cu) = ct (u) for all scalars c and all vectors u in R n Fact (box, page 67) If T is a linear transformation, then: T (c 1 v 1 + + c p v p ) = c 1 T (v 1 ) + + c p T (v p ) Fact (page 66) Every matrix transformation is a linear transformation. Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 9 / 88 Lecture 1 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 10 / 88

Lecture 2 Overview Goal for today: Learn to find the matrix of a linear transformation [section 1.9] Outline: 1 Matrix of a Linear Transformation 2 Linear Transformations Given Geometrically 3 Existence and Uniqueness Assignment: Read: 2.1 Work: section 1.9 (p. 79) #1, 3, 5, 7, 9, 11, 13, 15, 17, 23, 25 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 11 / 88 Lecture 2 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 12 / 88

Lecture 2 Matrix of a Linear Transformation Recall: A linear transformation is a function T : R n R m which preserves addition and scalar multiplication: T (u + v) = T (u) + T (v) for all vectors u, v in R n T (cu) = ct (u) for all scalars c and all vectors u in R n A matrix transformation has the form T (x) = Ax, where A is m n Every matrix transformation is a linear transformation. Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 13 / 88 Lecture 2 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 14 / 88

Standard Matrix Theorem 10 (page 72) Lecture 2 Let T : R n R m be a linear transformation. Then there exists a unique matrix A such that T (x) = Ax, for all x R n. A is called the standard matrix for the linear transformation T determined as: A = [T (e 1 )... T (e n )] Determine A: T : R 2 R 2 and reflects points over the vertical x 2 -axis. T : R 2 R 2 and horizontally shears points along the x 1 -axis by amount k. T : R 2 R 2 and rotates points clockwise by π/2. Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 15 / 88 Lecture 2 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 16 / 88

Lecture 2 Existence and Uniqueness Given T : R n R m with T (x) = Ax and a vector b R m : Is there a vector x R n such that T (x) = b? Is there only one vector x R n such that T (x) = b? Definition (page 76) A linear transformation T : R n R m is: onto if and only if every vector b R m is the image of at least one vector x R n. one-to-one if and only if every vector b R m is the image of at most one vector x R n. Theorem 12 (page 77) A linear transformation T : R n R m is: onto iff the columns of A span R m (pivot in each row) one-to-one iff the columns of A are linearly independent (pivot in each column) [Theorem 11: iff T (x) = 0 only for x = 0] Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 17 / 88 Lecture 2 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 18 / 88

Lecture 3 Overview Goal for today: Understand matrix multiplication [section 2.1] Outline: 1 Matrix Notation and Basic Operations 2 Matrix Multiplication 3 Properties Assignment (2.1): Read: section 2.2 Work: section 2.1 (p. 102) #1, 5, 7, 8, 11, 13, 15 19, 27 Extra practice: #3, 9, 21, 23, 25 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 19 / 88 Lecture 3 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 20 / 88

Lecture 3 Basic Definitions Definition Let A and B be n m matrices with entries a ij and b ij, respectively. 1 The main diagonal of a matrix is a 11, a 22,..., a nn. 2 A diagonal matrix has zero entries for all a ij except the main diagonal. 3 The zero matrix is a matrix of all zero entries. 4 The transpose of a matrix swaps rows and columns and is denoted as A 5 A and B are said to be equal if a ij = b ij for all i and j. 6 The entries of A + B are a ij + b ij. Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 21 / 88 Lecture 3 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 22 / 88

Lecture 3 Matrix Algebra - Addition and Scalar Multiplication Theorem 1 (page 95) Let A, B, and C be matrices of the same size, and let r and s be scalars. (1) A + B = B + A (4) r(a+b) = ra + rb (2) (A+B)+C = A+(B+C) (5) (r+s)a=ra + sa (3) A+0 = A (6) r(sa)=(rs)a Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 23 / 88 Lecture 3 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 24 / 88

Lecture 3 Matrix Multiplication Definition (page 97) If A is an m n matrix, and B is an n p matrix with columns b 1, b 2,..., b p, then their product AB is the m p matrix given by AB = A [ b 1 b 2... b p ] = [ Ab1 Ab 2... Ab p ] Note: must have number of columns of A = number of rows of B Definition (page 98) Row-Column Rule - with notation as in the definition above, the entry in row i, column j of the product AB is (AB) ij = a i1 b 1j + a i2 b 2j + + a in b nj = n a ik b kj k=1 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 25 / 88 Lecture 3 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 26 / 88

Lecture 3 Matrix Multiplication Fact In general AB BA Therefore matrix multiplication is NOT commutative! Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 27 / 88 Lecture 3 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 28 / 88

Lecture 3 Matrix Multiplication Let A, B, and C be matrices of the correct size. 1 Does AB = BA? Not in general. 2 If AB = AC then is B = C? Not in general. A = ( ) ( ) ( ) 1 0 2 6 2 6, B =, C = 0 0 1 1 3 5 3 If AB = 0 then is either A or B the zero matrix? Not in general. A = ( ) ( ) 1 0 0 0, B = 0 0 0 1 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 29 / 88 Lecture 3 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 30 / 88

Lecture 4 Overview Goal for today: Understand (and learn to compute) the matrix inverse [section 2.2] Outline: 1 Elementary Matrices 2 The Inverse of a Matrix 3 Computing the Inverse 4 Properties of the Inverse Assignment (2.2): Read: section 2.3 Work: section 2.2 (p. 111) #2, 5, 7, 9, 13, 16, 18, 19, 32 Extra practice: Remaining questions from 1-32. Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 31 / 88 Lecture 4 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 32 / 88

Elementary Matrices Definition Lecture 4 An elementary matrix is one that is obtained by performing a single elementary row operation on an identity matrix. An elementary matrix is: Always square. Always reversible (invertible) For a n n elementary matrix there are n or n + 1 nonzero entries Examples: What 3 3 elementary matrix swaps row 1 with row three? What 4 4 elementary matrix replaces row 1 by 2 row 1 plus 3 row 3? What 4 4 elementary matrix replaces row 3 by 2 row 1 plus 3 row 3? What 2 2 elementary matrix scales row 2 by 5? Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 33 / 88 Lecture 4 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 34 / 88

Lecture 4 Inverse of an n n Matrix Definition (page 105) An n n matrix is said to be invertible if there exists an n n matrix C such that CA = I and AC = I, where I is the n n identity matrix. We denote the inverse of A by A 1. 1 A matrix that is not invertible is called a singular matrix. 2 A matrix that is invertible is called a nonsingular matrix. Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 35 / 88 Lecture 4 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 36 / 88

Lecture 4 Gauss-Jordan Elimination Fact Given an n n matrix A. Then inverse exists if and only if there exists n linearly independent columns of the square matrix A. It is found by augmenting A with the n n identity matrix and casting it into a row reduced echelon form. The inverse is the matrix in the augmented position, that is, [ ] [ A I ] I A 1 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 37 / 88 Lecture 4 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 38 / 88

Utility of Matrix Inverses Lecture 4 Theorem 5 (page 106) If A is an invertible n n matrix, then for each b R n, the equation Ax = b has the unique solution x = A 1 b. Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 39 / 88 Lecture 4 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 40 / 88

Lecture 4 Utility of Matrix Inverses [contd] Theorem 6 (page 107) (a) If A is an invertible matrix, then A 1 is invertible and ( A 1) 1 = A. (b) If A and B are n n invertible matrices, then so is AB, and the inverse of AB is the product of the inverses of A and B in the reverse order, that is, (AB) 1 = B 1 A 1. (c) If A is an invertible matrix, then so is A, and the inverse of A is the transpose of A 1, that is, (A ) 1 = ( A 1). Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 41 / 88 Lecture 4 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 42 / 88

Lecture 4 Question on inverses 1 Row operations can be viewed as a matrix operating on another matrix. Are these operations invertible? 2 If A is an n m matrix with m linearly independent column vectors then an inverse exists. 3 Suppose AB = AC. If A is an invertible matrix then B = C. 4 Suppose AB = 0. If A is invertible matrix then B = 0. Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 43 / 88 Lecture 4 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 44 / 88

Lecture 5 Overview Goal for today: Fundamental theorems involving invertible matrices [section 2.3] Outline: 1 Matrix Inverses 2 The Invertible Matrix Theorem Assignment (2.3): Read: section 2.4 Work: section 2.3 (p. 117) #1, 3, 4, 8, 9, 11, 14, 15, 17 Extra practice: Remaining questions in 1-32, 41. Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 45 / 88 Lecture 5 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 46 / 88

Lecture 5 Exercise Prove the following. 1 If A is invertible then A 1 is unique. 2 If A and B are invertible matrices then AB is an invertible matrix. 3 If A is invertible then ( A 1) 1 = A. 4 If A is invertible iff A is invertible. Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 47 / 88 Lecture 5 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 48 / 88

True/False Lecture 5 In the following you may assume that the matrices are invertible and of the right size. 1 (A + B) 1 = A 1 + B 1 2 (AB) 1 = A 1 B 1 3 The solution to Ax = b is x = A 1 b. 4 If A = VDV 1 for some invertible matrix V and diagonal matrix D then A n = VD n V 1 5 If A = VDV 1 for some invertible matrix V and diagonal matrix D then exp(a) = V exp(a)v 1 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 49 / 88 Lecture 5 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 50 / 88

Matrix Inverse (review) Lecture 5 Definition (page 105) An n n matrix A is invertible if and only if there is an n n matrix C such that CA = I and AC = I. If so, C is unique and is called the inverse of A (denoted by C = A 1 ). Other words: A matrix that is invertible is called a nonsingular matrix A matrix that is not invertible is called a singular matrix Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 51 / 88 Lecture 5 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 52 / 88

Lecture 5 Gauss-Jordan Elimination Routine Method: (pages 110) To compute the inverse of an n n matrix A: 1 Form the augmented matrix [ A I ] 2 Use elementary row operations (EROs) to reduce this to [ I B ] 3 If this is possible, then B = A 1 ; if not, then A is not invertible. Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 53 / 88 Lecture 5 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 54 / 88

Lecture 5 The Invertible Matrix Theorem (Theorem 8, page 114) Let A be an n n matrix. The following are equivalent: a. A is invertible. b. A is row-equivalent to the identity matrix. c. A has n pivot positions. d. The equation Ax = 0 has only the trivial solution. e. The columns of A form a linearly independent set. f. The linear transformation x Ax is one-to-one. g. The equation Ax = b has at least one solution for each b in R n. h. The columns of A span R n. i. The linear transformation x Ax is onto (i.e, maps R n onto R m ). j. There is an n n matrix C such that CA = I. k. There is an n n matrix D such that AD = I. l. A T is invertible. Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 55 / 88 Lecture 5 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 56 / 88

Lecture 6 Overview Goal for today: Outline: Understand some practical aspects of matrix computations [Sections 2.3] 1 Nearly Singular Matrices 2 Condition Number 3 Partitioned Matrices [section 2.4] Assignment (2.4): Read: section 2.5 Work: section 2.4 (p. 123) #2, 8, 10, 11, 21 Extra practice: #3, 5, 6, 12, 13, 15 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 57 / 88 Lecture 6 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 58 / 88

Lecture 6 Invertible Matrix Theorem (Recap) Assume A is an n n matrix (True/False): 1 If there is an n n matrix D such that AD = I, then DA = I. 2 If the span of the columns of an n n matrix is R n then the matrix is invertible. 3 If there exists a nontrivial solution to Ax = 0 then A is invertible. 4 If the matrix A has n pivot columns then the row reduced echelon form of A is equivalent to I. 5 If the matrix A and the equation Ax = b are consistent for each b R n then the matrix A is invertible. Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 59 / 88 Lecture 6 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 60 / 88

Lecture 6 Nearly Singular Matrices We know: Every square matrix is either nonsingular or singular (Theorem 8). In practice: A nonsingular square matrix may be nearly singular and be just as bad as a singular matrix. For a linear system Ax = b with a nearly singular matrix A: The solution x is sensitive to small changes in the data b. This sensitivity depends on the system not the solution method. Reducing the sensitivity requires reformulating the problem. The sensitivity is measured by the condition number. Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 61 / 88 Lecture 6 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 62 / 88

Lecture 6 Condition Number [see Numerical Notes, page 116] Fact If A is nonsingular, b 0, and Ax = b and Aˆx = ˆb, then ˆx x x cond(a) ˆb b b In Matlab: cond(a) is the condition number of a matrix A. cond(a) 1 are problematic in computations. RCOND is an estimate of its reciprocal 1/ cond(a) Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 63 / 88 Lecture 6 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 64 / 88

Lecture 6 Partitioned Matrices Idea: Partition (split) matrices into blocks Do matrix operations blockwise Fact (section 2.4) Matrix addition, scalar multiplication, and matrix multiplication may be computed blockwise if the numbers of blocks and their sizes match appropriately (the matrices are partitioned comformably). Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 65 / 88 Lecture 6 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 66 / 88

Lecture 7 Overview Goal for today: Learn to find and use the LU factorization [section 2.5] Outline: 1 Using A = LU 2 Finding A = LU Assignment (2.5): Read: section 2.7 (skip 2.6) Work: section 2.5 (p. 131) #1, 4, 5, 7, 9, 12, 32 Extra practice: #3, 11, 13 *This problem can also be done easily by hand. Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 67 / 88 Lecture 7 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 68 / 88

Lecture 7 Using the Factorization A = LU Idea: Factor A = LU with L and U lower- and upper-triangular Represents the row-reduction process in matrix form Method (page 126): To solve Ax = b given L and U: 1 Solve Ly = b for y 2 Solve Ux = y for x Why use the LU factorization? Consider the operation counts: Find A 1 : 2n 3 Use A 1 : 2n 2 n Find L, U: 2 3 n3 Use L, U: 2n 2 n Conclusion: Using LU factorization is three times faster than using the inverse Compute L and U once, then reuse for subsequent linear systems This is the way most software is organized (e.g., LAPACK) Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 69 / 88 Lecture 7 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 70 / 88

Lecture 7 Computing the Factorization A = LU Idea: Details: Notes: Reduce A to U (echelon form) Record the EROs used to form L Use only replacement operations To change a i,j to zero use the operation R i m i,j R j R i Store multiplier m i,j = a i,j /a j,j in corresponding location in L Textbook version (pages 128 129) is the same (without notation) Possible to incorporate row interchanges (called pivoting) This is the best method for dense linear systems of moderate size Used by almost all software (including MATLAB) Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 71 / 88 Lecture 7 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 72 / 88

Lecture 8 Overview Goal for today: Understand and learn how to develop a LU factorization [section 2.5] Outline: 1 LU basic idea (review) 2 Examples Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 73 / 88 Lecture 8 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 74 / 88

Lecture 8 LU Factorization Fundamental idea: Reduce A to U (echelon form) Record the EROs used to form L The matrix A = LU Fundamental rules: To eliminate a i,j use the operation R i m i,j R j R i where m i,j = a i,j /a j,j Store multiplier m i,j = a i,j /a j,j in l i,j of the lower triangular matrix L (caution with rectangular matrices) Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 75 / 88 Lecture 8 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 76 / 88

Example 1 Lecture 8 Determine the LU factorization of the matrix: 3 7 2 A = 3 5 1 6 4 0 A 3 7 2 0 2 1, L = 0 10 4 3 7 2 0 2 1 0 0 9 = U, L = 1 0 0 1 1 0 2 1 1 0 0 1 1 0 2 5 1 How can we check this factorization? Multiply L times U and show it equals A. So there exists a mistake on this slide! Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 77 / 88 Lecture 8 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 78 / 88

Example 2 Lecture 8 Determine the LU factorization of the matrix: A A = 1 2 2 3 0 3 6 0 0 0 2 4 0 12 20 7 1 2 2 3 0 3 6 0 0 0 2 4 0 0 4 7 1 2 2 3 0 3 6 0 0 0 2 4 0 0 0 1 1 2 2 3 3 9 0 9 1 2 4 7 3 6 26 2, L =, L = = U, L = 1 0 0 0 3 1 0 0 1 1 0 3 1 1 0 0 0 3 1 0 0 1 0 1 0 3 4 1 1 0 0 0 3 1 0 0 1 0 1 0 3 4 2 1 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 79 / 88 Lecture 8 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 80 / 88

Example 3 Lecture 8 Determine the LU factorization of the matrix: 2 4 2 3 6 9 5 8 A = 2 7 3 9 4 2 2 1 6 3 3 4 A A 2 4 2 3 0 3 1 1 0 3 1 6 0 6 2 7 0 9 3 13 2 4 2 3 0 3 1 1 0 0 0 5 0 0 0 5 0 0 0 10, L =, L = 1 0 0 0 0 3 1 0 0 0 1 1 0 0 2 1 0 3 1 1 0 0 0 0 3 1 0 0 0 1 1 1 0 0 2 2 1 0 3 3 1 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 81 / 88 Lecture 8 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 82 / 88

Example 3 - Continued Lecture 8 A A 2 4 2 3 0 3 1 1 0 0 0 5 0 0 0 5 0 0 0 10 2 4 2 3 0 3 1 1 0 0 0 5 0 0 0 0 0 0 0 0 1 0 0 0 0, L = 3 1 0 0 0 1 1 1 0 0 2 2 1 0 3 3 1 1 0 0 0 0 = U, L = 3 1 0 0 0 1 1 1 0 0 2 2 1 1 0 3 3 2 0 1 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 83 / 88 Lecture 8 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 84 / 88

Lecture 8 Using LU Consider the matrix equation Ax = b. If you are given L and U then: 1 LUx = b 2 Solve Ly = b through a forward substitution 3 Solve Ux = y through a backward substitution Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 85 / 88 Lecture 8 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 86 / 88

Lecture 8 Example 1 Solve for x in LUx = b where 3 7 2 U = 0 2 1, L = 0 0 9 1 0 0 1 1 0, b = 2 5 1 1 0 2 Step One: Solve Ly = b [L b] = 1 0 0 1 1 1 0 0, y = 2 5 1 2 1 1 5 Step Two: Solve Ux = y 3 7 2 1 [U y] = 0 2 1 1, x = 0 0 9 5 5/9 2/9 5/9 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 87 / 88 Lecture 8 Linear Algebra (MTH 464) Lecture Outlines February 6, 2018 88 / 88