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

Similar documents
Linear Independence. Stephen Boyd. EE103 Stanford University. October 9, 2017

Lecture 6. Numerical methods. Approximation of functions

Least Squares. Stephen Boyd. EE103 Stanford University. October 28, 2017

GAUSSIAN ELIMINATION AND LU DECOMPOSITION (SUPPLEMENT FOR MA511)

4. Matrix inverses. left and right inverse. linear independence. nonsingular matrices. matrices with linearly independent columns

Worksheet for Lecture 25 Section 6.4 Gram-Schmidt Process

Review : Powers of a matrix

Linear Systems and Matrices

9. Numerical linear algebra background

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

Section 6.4. The Gram Schmidt Process

Math 520 Exam 2 Topic Outline Sections 1 3 (Xiao/Dumas/Liaw) Spring 2008

Econ Slides from Lecture 7

MATH 167: APPLIED LINEAR ALGEBRA Least-Squares

CSL361 Problem set 4: Basic linear algebra

1. What is the determinant of the following matrix? a 1 a 2 4a 3 2a 2 b 1 b 2 4b 3 2b c 1. = 4, then det

Math 224, Fall 2007 Exam 3 Thursday, December 6, 2007

Math Linear Algebra Final Exam Review Sheet

Linear algebra I Homework #1 due Thursday, Oct Show that the diagonals of a square are orthogonal to one another.

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

Math 407: Linear Optimization

9. Numerical linear algebra background

Problem Set (T) If A is an m n matrix, B is an n p matrix and D is a p s matrix, then show

MATH 369 Linear Algebra

HW2 Solutions

Computational Methods. Least Squares Approximation/Optimization

18.06 Quiz 2 April 7, 2010 Professor Strang

Review of Linear Algebra

Q T A = R ))) ) = A n 1 R

MATH Topics in Applied Mathematics Lecture 12: Evaluation of determinants. Cross product.

ELE/MCE 503 Linear Algebra Facts Fall 2018

STAT 309: MATHEMATICAL COMPUTATIONS I FALL 2018 LECTURE 9

AMS526: Numerical Analysis I (Numerical Linear Algebra)

MAT 2037 LINEAR ALGEBRA I web:

Math 489AB Exercises for Chapter 2 Fall Section 2.3

1 Last time: least-squares problems

LINEAR ALGEBRA 1, 2012-I PARTIAL EXAM 3 SOLUTIONS TO PRACTICE PROBLEMS

Chapter 4. Solving Systems of Equations. Chapter 4

There are two things that are particularly nice about the first basis

Chapter 1: Systems of Linear Equations and Matrices

Matrix Arithmetic. j=1

Conceptual Questions for Review

Appendix A: Matrices

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

Orthogonal Transformations

Numerical Linear Algebra Homework Assignment - Week 2

235 Final exam review questions

Eigenvalues and Eigenvectors

2. Every linear system with the same number of equations as unknowns has a unique solution.

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

Instructions Please answer the five problems on your own paper. These are essay questions: you should write in complete sentences.

MATH 2360 REVIEW PROBLEMS

Lecture 3: QR-Factorization

MATH 167: APPLIED LINEAR ALGEBRA Chapter 3

Matrix Algebra Determinant, Inverse matrix. Matrices. A. Fabretti. Mathematics 2 A.Y. 2015/2016. A. Fabretti Matrices

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

Orthonormal Transformations and Least Squares

Math 343 Midterm I Fall 2006 sections 002 and 003 Instructor: Scott Glasgow

(the matrix with b 1 and b 2 as columns). If x is a vector in R 2, then its coordinate vector [x] B relative to B satisfies the formula.

orthogonal relations between vectors and subspaces Then we study some applications in vector spaces and linear systems, including Orthonormal Basis,

Steven J. Leon University of Massachusetts, Dartmouth

Solution to Homework 8, Math 2568

MATH 1120 (LINEAR ALGEBRA 1), FINAL EXAM FALL 2011 SOLUTIONS TO PRACTICE VERSION

MA 265 FINAL EXAM Fall 2012

Linear algebra II Homework #1 solutions A = This means that every eigenvector with eigenvalue λ = 1 must have the form

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

SOLUTIONS: ASSIGNMENT Use Gaussian elimination to find the determinant of the matrix. = det. = det = 1 ( 2) 3 6 = 36. v 4.

TBP MATH33A Review Sheet. November 24, 2018

Chapter 3. Vector spaces

Introduction to Matrices

Glossary of Linear Algebra Terms. Prepared by Vince Zaccone For Campus Learning Assistance Services at UCSB

Lecture 4: Applications of Orthogonality: QR Decompositions

MATH 300, Second Exam REVIEW SOLUTIONS. NOTE: You may use a calculator for this exam- You only need something that will perform basic arithmetic.

3 Matrix Algebra. 3.1 Operations on matrices

I. Multiple Choice Questions (Answer any eight)

MATH 350: Introduction to Computational Mathematics

[ Here 21 is the dot product of (3, 1, 2, 5) with (2, 3, 1, 2), and 31 is the dot product of

5. Orthogonal matrices

LINEAR ALGEBRA SUMMARY SHEET.

Eigenvalues and Eigenvectors

CS 246 Review of Linear Algebra 01/17/19

Math 54 HW 4 solutions

(b) If a multiple of one row of A is added to another row to produce B then det(b) =det(a).

(a) II and III (b) I (c) I and III (d) I and II and III (e) None are true.

Orthogonality. 6.1 Orthogonal Vectors and Subspaces. Chapter 6

Review 1 Math 321: Linear Algebra Spring 2010

ECS130 Scientific Computing. Lecture 1: Introduction. Monday, January 7, 10:00 10:50 am

IMPORTANT DEFINITIONS AND THEOREMS REFERENCE SHEET

Applied Linear Algebra

ELEMENTARY LINEAR ALGEBRA WITH APPLICATIONS. 1. Linear Equations and Matrices

Linear Algebra. and

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

PRACTICE PROBLEMS (TEST I).

Orthonormal Transformations

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

(Mathematical Operations with Arrays) Applied Linear Algebra in Geoscience Using MATLAB

4. Determinants.

Chapter 3 Transformations

Recall : Eigenvalues and Eigenvectors

Typical Problem: Compute.

Transcription:

Inverses Stephen Boyd EE103 Stanford University October 28, 2017

Outline Left and right inverses Inverse Solving linear equations Examples Pseudo-inverse Left and right inverses 2

Left inverses a number x that satisfies xa = 1 is called the inverse of a inverse (i.e., 1/a) exists if and only if a 0, and is unique a matrix X that satisfies XA = I is called a left inverse of A (and we say that A is left-invertible) example: the matrix has two different left inverses: B = 1 [ 11 10 16 9 7 8 11 3 4 A = 4 6 1 1 ], C = 1 [ 0 1 6 2 0 1 4 ] Left and right inverses 3

Left inverse and column independence if A has a left inverse C then the columns of A are independent to see this: if Ax = 0 and CA = I then 0 = C0 = C(Ax) = (CA)x = Ix = x we ll see later the converse is also true, so a matrix is left-invertible if and only if its columns are independent matrix generalization of a number is invertible if and only if it is nonzero so left-invertible matrices are tall or square Left and right inverses 4

Solving linear equations with a left inverse suppose Ax = b, and A has a left inverse C then Cb = C(Ax) = (CA)x = Ix = x so multiplying the right-hand side by a left inverse yields the solution Left and right inverses 5

Example A = 3 4 4 6 and two different left inverses, 1 1 B = 1 9 [ 11 10 16 7 8 11 ], C = 1 [ 0 1 6 2 0 1 4 over-determined equations Ax = (1, 2, 0) have (unique) solution x = (1, 1) we get B(1, 2, 0) = (1, 1) and also C(1, 2, 0) = (1, 1) ] Left and right inverses 6

Right inverses a matrix X that satisfies AX = I is a right inverse of A (and we say that A is right-invertible) A is right-invertible if and only if A T is left-invertible: so we conclude AX = I (AX) T = I X T A T = I A is right-invertible if and only if its rows are linearly independent right-invertible matrices are wide or square Left and right inverses 7

Solving linear equations with a right inverse suppose A has a right inverse B consider the (square or underdetermined) equations Ax = b x = Bb is a solution: Ax = A(Bb) = (AB)b = Ib = b so Ax = b has a solution for any b Left and right inverses 8

Example same A, B, C in example above C T and B T are both right inverses of A T under-determined equations A T x = (1, 2) has (different) solutions B T (1, 2) = (1/3, 2/3, 38/9) C T (1, 2) = (0, 1/2, 1) (there are many other solutions as well) Left and right inverses 9

Outline Left and right inverses Inverse Solving linear equations Examples Pseudo-inverse Inverse 10

Inverse if A has a left and a right inverse, they are unique and equal (and we say that A is invertible) so A must be square to see this: if AX = I, Y A = I X = IX = (Y A)X = Y (AX) = Y I = Y we denote them by A 1 : A 1 A = AA 1 = I inverse of inverse: (A 1 ) 1 = A Inverse 11

Solving square systems of linear equations suppose A is invertible for any b, Ax = b has the unique solution x = A 1 b matrix generalization of simple scalar equation ax = b having solution x = (1/a)b (for a 0) simple-looking formula x = A 1 b is basis for many applications Inverse 12

Invertible matrices the following are equivalent for a square matrix A: A is invertible columns of A are linearly independent rows of A are linearly independent A has a left inverse A has a right inverse if any of these hold, all others do Inverse 13

Examples I 1 = I if Q is orthogonal, i.e., Q T Q = I, then Q 1 = Q T 2 2 matrix A is invertible if and only A 11 A 22 A 12 A 21 [ ] A 1 1 A22 A = 12 A 11 A 22 A 12 A 21 A 21 A 11 you need to know this formula there are similar but much more complicated formulas for larger matrices (and no, you do not need to know them) Inverse 14

Non-obvious example A = 1 2 3 0 2 2 3 4 4 is invertible, with inverse A 1 = 1 30 0 20 10 6 5 2 6 10 2 verified by checking AA 1 = I (or A 1 A = I) we ll soon see how to compute the inverse. Inverse 15

Properties (AB) 1 = B 1 A 1 (provided inverses exist) (A T ) 1 = (A 1 ) T (sometimes denoted A T ) negative matrix powers: (A 1 ) k is denoted A k with A 0 = I, identity A k A l = A k+l holds for any integers k, l Inverse 16

Triangular matrices lower triangular L with nonzero diagonal entries is invertible so see this, write Lx = 0 as L 11 x 1 = 0 L 21 x 1 + L 22 x 2 = 0. L n1 x 1 + L n2 x 2 + + L n,n 1 x n 1 + L nn x n = 0 from first equation, x 1 = 0 (since L 11 0) second equation reduces to L 22x 2 = 0, so x 2 = 0 (since L 22 0) and so on this shows columns of L are independent, so L is invertible upper triangular R with nonzero diagonal entries is invertible Inverse 17

Inverse via QR factorization suppose A is square and invertible so its columns are linearly independent so Gram-Schmidt gives QR factorization A = QR Q is orthogonal: Q T Q = I R is upper triangular with positive diagonal entries, hence invertible so we have A 1 = (QR) 1 = R 1 Q 1 = R 1 Q T Inverse 18

Outline Left and right inverses Inverse Solving linear equations Examples Pseudo-inverse Solving linear equations 19

Back substitution suppose R is upper triangular with nonzero diagonal entries write out Rx = b as R 11 x 1 + R 12 x 2 + + R 1,n 1 x n 1 + R 1n x n = b 1 R n 1,n 1 x n 1 + R n 1,n x n = b n 1. R nn x n = b n from last equation we get x n = b n /R nn from 2nd to last equation we get x n 1 = (b n 1 R n 1,n x n )/R n 1,n 1 continue to get x n 2, x n 3,..., x 1 Solving linear equations 20

Back substitution called back substitution since we find the variables in reverse order, substituting the already known values of x i computes x = R 1 b complexity: first step requires 1 flop (division) 2nd step needs 3 flops ith step needs 2i 1 flops total is 1 + 3 + + (2n 1) = n 2 flops Solving linear equations 21

Solving linear equations via QR factorization assuming A is invertible, let s solve Ax = b, i.e., compute x = A 1 b with QR factorization A = QR, we have A 1 = (QR) 1 = R 1 Q T compute x = R 1 (Q T b) by back substitution Solving linear equations 22

Solving linear equations via QR factorization given an n n invertible matrix A and an n-vector b 1. QR factorization. Compute the QR factorization A = QR. 2. Compute Q T b. 3. Back substitution. Solve the triangular equation Rx = Q T b using back substitution. complexity 2n 3 (step 1), 2n 2 (step 2), n 2 (step 3) total is 2n 3 + 3n 2 2n 3 Solving linear equations 23

Multiple right-hand sides let s solve Ax i = b i, i = 1,..., k, with A invertible carry out QR factorization once (2n 3 flops) for i = 1,..., k, solve Rx i = Q T b i via back substitution (3kn 2 flops) total is 2n 3 + 2kn 2 flops if k is small compared to n, same cost as solving one set of equations Solving linear equations 24

Outline Left and right inverses Inverse Solving linear equations Examples Pseudo-inverse Examples 25

Polynomial interpolation let s find coefficients of a cubic polynomial that satisfies p(x) = c 1 + c 2 x + c 3 x 2 + c 4 x 3 p( 1.1) = b 1, p( 0.4) = b 2, p(0.1) = b 3, p(0.8) = b 4 write as Ac = b, with A = 1 1.1 ( 1.1) 2 ( 1.1) 3 1 0.4 ( 0.4) 2 ( 0.4) 3 1 0.1 (0.1) 2 (0.1) 3 1 0.8 (0.8) 2 (0.8) 3 Examples 26

Polynomial interpolation (unique) coefficients given by c = A 1 b, with A 1 = 0.0201 0.2095 0.8381 0.0276 0.1754 2.1667 1.8095 0.1817 0.3133 0.4762 1.6667 0.8772 0.6266 2.381 2.381 0.6266 so, e.g., c 1 is not very sensitive to b 1 or b 4 first column gives coefficients of polynomial that satisfies p( 1.1) = 1, p( 0.4) = 0, p(0.1) = 0, p(0.8) = 0 called (first) Lagrange polynomial Examples 27

Example p(x) 1.5 1 0.5 0 0.5 1 x Examples 28

Lagrange polynomials p(x) p(x) 1 1 0 0 1.5 1 0.5 0 0.5 1 x 1.5 1 0.5 0 0.5 1 x p(x) p(x) 1 1 0 0 x x 1.5 1 0.5 0 0.5 1 1.5 1 0.5 0 0.5 1 Examples 29

Outline Left and right inverses Inverse Solving linear equations Examples Pseudo-inverse Pseudo-inverse 30

Invertibility of Gram matrix A has independent columns A T A is invertible to see this, we ll show that Ax = 0 A T Ax = 0 : if Ax = 0 then (A T A)x = A T (Ax) = A T 0 = 0 : if (A T A)x = 0 then 0 = x T (A T A)x = (Ax) T (Ax) = Ax 2 = 0 so Ax = 0 Pseudo-inverse 31

Pseudo-inverse of tall matrix the pseudo-inverse of A with independent columns is A = (A T A) 1 A T it is a left inverse of A: A A = (A T A) 1 A T A = (A T A) 1 (A T A) = I (we ll soon see that it s a very important left inverse of A) reduces to A 1 when A is square: A = (A T A) 1 A T = A 1 A T A T = A 1 I = A 1 Pseudo-inverse 32

Pseudo-inverse of wide matrix if A is wide, with independent rows, AA T is invertible pseudo-inverse is defined as A = A T (AA T ) 1 A is a right inverse of A: AA = AA T (AA T ) 1 = I (we ll see later it is an important right inverse) reduces to A 1 when A is square: A T (AA T ) 1 = A T A T A 1 = A 1 Pseudo-inverse 33

Pseudo-inverse via QR factorization suppose A has independent columns, A = QR then A T A = (QR) T (QR) = R T Q T QR = R T R so A = (A T A) 1 A T = (R T R) 1 (QR) T = R 1 R T R T Q T = R 1 Q T can compute A using back substitution on columns of Q T for A with independent rows, A = QR T Pseudo-inverse 34