I.1 Multiplication Ax Using Columns of A

Similar documents
THE NULLSPACE OF A: SOLVING AX = 0 3.2

Linear Algebra V = T = ( 4 3 ).

GEOMETRY OF MATRICES x 1

Linear Algebra, Summer 2011, pt. 2

4 ORTHOGONALITY ORTHOGONALITY OF THE FOUR SUBSPACES 4.1

MA 0540 fall 2013, Row operations on matrices

Math 215 HW #9 Solutions

[Disclaimer: This is not a complete list of everything you need to know, just some of the topics that gave people difficulty.]

Linear Algebra Primer

An overview of key ideas

v = ( 2)

18.06 Problem Set 3 Solution Due Wednesday, 25 February 2009 at 4 pm in Total: 160 points.

Chapter 7. Optimization and Minimum Principles. 7.1 Two Fundamental Examples. Least Squares

18.06 Problem Set 3 Due Wednesday, 27 February 2008 at 4 pm in

is Use at most six elementary row operations. (Partial

CS123 INTRODUCTION TO COMPUTER GRAPHICS. Linear Algebra 1/33

Conceptual Questions for Review

Contents. 1 Vectors, Lines and Planes 1. 2 Gaussian Elimination Matrices Vector Spaces and Subspaces 124

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

Elementary Linear Algebra Review for Exam 2 Exam is Monday, November 16th.

Eigenvalues and Eigenvectors

Linear Algebra, Summer 2011, pt. 3

7. Dimension and Structure.

This lecture is a review for the exam. The majority of the exam is on what we ve learned about rectangular matrices.

Linear Algebra March 16, 2019

CS123 INTRODUCTION TO COMPUTER GRAPHICS. Linear Algebra /34

Getting Started with Communications Engineering. Rows first, columns second. Remember that. R then C. 1

1 Last time: determinants

Math 416, Spring 2010 The algebra of determinants March 16, 2010 THE ALGEBRA OF DETERMINANTS. 1. Determinants

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

ANSWERS (5 points) Let A be a 2 2 matrix such that A =. Compute A. 2

1 Notes for lectures during the week of the strike Part 2 (10/25)

Math Linear Algebra Final Exam Review Sheet

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

Math 290, Midterm II-key

MITOCW ocw f99-lec01_300k

EXERCISE SET 5.1. = (kx + kx + k, ky + ky + k ) = (kx + kx + 1, ky + ky + 1) = ((k + )x + 1, (k + )y + 1)

18.06SC Final Exam Solutions

Review of linear algebra

Answers in blue. If you have questions or spot an error, let me know. 1. Find all matrices that commute with A =. 4 3

18.06 Problem Set 3 - Solutions Due Wednesday, 26 September 2007 at 4 pm in

B553 Lecture 5: Matrix Algebra Review

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

Systems of Linear Equations

Homework Set #8 Solutions

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

Spring 2015 Midterm 1 03/04/15 Lecturer: Jesse Gell-Redman

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

LINEAR ALGEBRA KNOWLEDGE SURVEY

Assignment 1 Math 5341 Linear Algebra Review. Give complete answers to each of the following questions. Show all of your work.

Linear Algebra. and

Lecture 1 Systems of Linear Equations and Matrices

HOMEWORK PROBLEMS FROM STRANG S LINEAR ALGEBRA AND ITS APPLICATIONS (4TH EDITION)

YORK UNIVERSITY. Faculty of Science Department of Mathematics and Statistics MATH M Test #1. July 11, 2013 Solutions

Properties of Matrices and Operations on Matrices

Gaussian elimination

MATH 2030: ASSIGNMENT 4 SOLUTIONS

Linear Algebra. Min Yan

Linear Algebra. Chapter Linear Equations

Span and Linear Independence

Extra Problems for Math 2050 Linear Algebra I

MATH 167: APPLIED LINEAR ALGEBRA Least-Squares

Linear Algebra. 1.1 Introduction to vectors 1.2 Lengths and dot products. January 28th, 2013 Math 301. Monday, January 28, 13

Problem Set # 1 Solution, 18.06

Chapter 1. Vectors, Matrices, and Linear Spaces

Linear Equation: a 1 x 1 + a 2 x a n x n = b. x 1, x 2,..., x n : variables or unknowns

Elementary maths for GMT

22m:033 Notes: 1.3 Vector Equations

Lecture 2 Systems of Linear Equations and Matrices, Continued

MATH 22A: LINEAR ALGEBRA Chapter 4

SOLUTIONS TO EXERCISES FOR MATHEMATICS 133 Part 1. I. Topics from linear algebra

Signature. Printed Name. Math 312 Hour Exam 1 Jerry L. Kazdan March 5, :00 1:20

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

4 Elementary matrices, continued

MATH 221: SOLUTIONS TO SELECTED HOMEWORK PROBLEMS

Math 54 First Midterm Exam, Prof. Srivastava September 23, 2016, 4:10pm 5:00pm, 155 Dwinelle Hall.

MATH.2720 Introduction to Programming with MATLAB Vector and Matrix Algebra

Solutions to Math 51 First Exam October 13, 2015

Solution Set 3, Fall '12

9. Numerical linear algebra background

MATH 167: APPLIED LINEAR ALGEBRA Chapter 3

Linear Algebra in A Nutshell

Second Midterm Exam April 14, 2011 Answers., and

Math 3191 Applied Linear Algebra

v = v 1 2 +v 2 2. Two successive applications of this idea give the length of the vector v R 3 :

SECTION 3.3. PROBLEM 22. The null space of a matrix A is: N(A) = {X : AX = 0}. Here are the calculations of AX for X = a,b,c,d, and e. =

Applied Linear Algebra in Geoscience Using MATLAB

Starting with Two Matrices

4 Elementary matrices, continued

Linear Algebra Review. Fei-Fei Li

Math 308 Midterm Answers and Comments July 18, Part A. Short answer questions

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

6 EIGENVALUES AND EIGENVECTORS

Notes on Row Reduction

A Brief Outline of Math 355

Math 2331 Linear Algebra

Vector Spaces. Addition : R n R n R n Scalar multiplication : R R n R n.

Image Registration Lecture 2: Vectors and Matrices

Chapter 2. Matrix Arithmetic. Chapter 2

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

Transcription:

2 Highlights of Linear Algebra I. Multiplication Ax Using Columns of A We hope you already know some linear algebra. It is a beautiful subject more useful to more people than calculus (in our quiet opinion). But even old-style linear algebra courses miss basic and important facts. This first section of the book is about matrix-vector multiplicationax and the column space of a matrix. We always use examples to make our point clear. Example Multiply A times x using the three rows of A. Then use the two columns : By rows 2 3 2 4 x = 2x +3x 2 inner products 2x x +4x 2 = of the rows 3 7 2 3x +7x 2 with x = (x,x 2 ) By columns 2 3 2 4 x = x x 2 2 +x 2 3 combination 4 = of the columns 3 7 2 3 7 a anda 2 You see that both ways give the same result. The first way (a row at a time) produces 3 inner products. Those are also known as dot products because of the dot notation : row column = (2, 3) (x, x 2 ) = 2x +3x 2 () This is the way to find the three separate components ofax. We use this for computing but not for understanding. It is low level. Understanding is higher level, using vectors. The vector approach seesax as a linear combination ofa anda 2. This is the fundamental operation of linear algebra! A linear combination ofa anda 2 includes two steps : () Multiply the columnsa anda 2 by scalars x andx 2 (2) Add vectorsx a +x 2 a 2 = Ax. Thus Ax is a linear combination of the columns ofa. This is fundamental. This thinking leads us to the column space ofa. The key idea is to take all combinations of the columns. All real numbersx and x 2 are allowed the space includesax for all vectorsx. In this way we get infinitely many output vectorsax. And we can see those outputs geometrically. In our example, each Ax is a vector in 3-dimensional space. That 3D space is called R 3. (The R indicates real numbers. Vectors with three complex components lie in the space C 3.) We stay with real vectors and we ask this key question : All combinationsax = x a +x 2 a 2 produce what part of the full3d space? Answer : Those vectors produce a plane. The plane contains the complete line in the direction of a = (2,2,3), since every vector x a is included. The plane also includes the line of all vectors x 2 a 2 in the direction of a 2. And it includes the sum of any vector on one line plus any vector on the other line. This addition fills out an infinite plane containing the two lines. But it does not fill out the whole 3-dimensional space R 3.

I.. MultiplicationAx Using Columns of A 3 Definition The combinations of the columns fill out( span ) the column space ofa. Here the column space is a plane. That plane includes the zero point (0,0,0) which is produced whenx = x 2 = 0. The plane includes(5,6,0) = a +a 2 and(, 2, 4)= a a 2. Every combination x a + x 2 a 2 is in this column space. With probability it does not include the random point rand(3, )! Which points are in the plane? b=(b,b 2,b 3 ) is in the column space ofaexactly when Ax=b has a solution(x,x 2 ) When you see that truth, you understand the column space C(A) : The solution x shows how to express the right sidebas a combinationx a +x 2 a 2 of the columns. For someb this is impossible. Example 2 b= is not in C(A). Ax = 2x +3x 2 2x +4x 2 = is unsolvable. 3x +7x 2 ( ) The first two equations forcex = 2 andx 2 = 0. Then equation3fails : 3 +7(0)=.5 (not). This means that b = (,,) is not in the column space the plane of a anda 2. Example 3 What are the column spaces ofa 2 = 2 3 5 2 4 6 anda 3 = 2 3 2 4? 3 7 0 3 7 Solution. The column space ofa 2 is the same plane as before. The new column(5,6,0) is the sum of column + column 2. So a 3 = column 3 is already in the plane and adds nothing new. By including this dependent column we don t go beyond the original plane. The column space ofa 3 is the whole3d space R 3. Example2showed us that the new third column(,,) is not in the plane C(A). Our column space C(A 3 ) has grown bigger. But there is nowhere to stop between a plane and the full 3D space. Visualize the x y plane and a third vector(x 3,y 3,z 3 ) out of the plane (meaning thatz 3 0). They combine to give every vector in R 3. Here is a total list of all possible column spaces inside R 3. Dimensions0,,2,3 : Subspaces of R 3 The zero vector(0,0,0) by itself A line of all vectorsx a A plane of all vectorsx a +x 2 a 2 The whole R 3 with all vectorsx a +x 2 a 2 +x 3 a 3 In that list we need the vectorsa,a 2,a 3 to be independent. The only combination that gives the zero vector is 0a + 0a 2 + 0a 3. So a by itself gives a line, a and a 2 give a plane, a and a 2 and a 3 give every vector b in R 3. The zero vector is in every subspace! In linear algebra language : Three independent columns in R 3 produce an invertible matrix : AA =A A= I. Ax = 0 requires x = (0,0,0). Then Ax = b has exactly one solutionx = A b. You see the picture for the columns of an n by n invertible matrix. Their combinations fill its column space : all of R n. We needed those ideas and that language to go further. 2

4 Highlights of Linear Algebra Independent Columns and the Rank ofa After writing those words, I thought this short section was complete. Wrong. With just a small effort, we can find a basis for the column space of A, we can factor A into C times R, and we can prove the first great theorem in linear algebra. You will see the rank of a matrix and the dimension of a subspace. All this comes with an understanding of independence. The goal is to create a matrixc whose columns come directly from A but not to include any column that is a combination of previous columns. The columns of C (as many as possible) will be independent. Here is a natural construction of C from the n columns of A : If columnofais not all zero, put it into the matrixc. If column2ofais not a multiple of column, put it intoc. If column3ofais not a combination of columnsand2, put it intoc. Continue. At the endc will haver columns(r n). They will be a basis for the column space ofa. The left out columns are combinations of those basic columns in C. A basis for a subspace is a full set of independent vectors : All vectors in the space are combinations of the basis vectors. Examples will make the point. Example 4 If A = 3 8 2 6 thenc = 3 2 0 n = 3 columns in A r = 2 columns inc Column 3 of A is 2 (column ) + 2 (column 2). Leave it out of the basis in C. Example 5 If A = 2 3 0 4 5 n = 3 columns ina thenc = A. r = 3 columns inc 0 0 6 This matrixais invertible. Its column space is all of R 3. Keep all 3 columns. Example 6 If A = 2 5 2 5 2 5 thenc = n = 3 columns ina r = column in C The numberr is the rank ofa. It is also the rank ofc. It counts independent columns. Admittedly we could have moved from right to left in A, starting with its last column. This would not change the final count r. Different basis, but always the same number of vectors. That numberr is the dimension of the column space ofaandc (same space). The rank of a matrix is the dimension of its column space.

I.. MultiplicationAx Using Columns of A 5 The matrix C connects to A by a third matrix R : A = CR. Their shapes are (m by n) = (m by r) (r by n). I can show this factorization of A in Example 4 above : A = 3 8 2 6 = 3 2 0 0 2 = CR (2) WhenC multiplies the first column ofr, this produces columnofc anda. 0 0 When C multiplies the second column ofr, we get column2ofc anda. 2 When C multiplies the third column of R, we get 2(column) + 2(column2). 2 This matches column 3 of A. All we are doing is to put the right numbers in R. Combinations of the columns of C produce the columns of A. Then A = CR stores this information as a matrix multiplication. ActuallyRis a famous matrix in linear algebra : R = rref(a) = row-reduced echelon form of A (without zero rows). Example 5 has C = A and then R = I (identity matrix). Example 6 has only one column inc, so it has one row in R : A = 2 5 2 5 = 2 5 All three matrices have rank r = = CR Column Rank = Row Rank 2 5 The number of independent columns equals the number of independent rows This rank theorem is true for every matrix. Always columns and rows in linear algebra! Themrows contain the same numbersa ij as thencolumns. But different vectors. The theorem is proved by A = CR. Look at that differently by rows instead of columns. The matrixrhasr rows. Multiplying byc takes combinations of those rows. Since A = CR, we get every row of A from the r rows of R. And those r rows are independent, so they are a basis for the row space ofa. The column space and row space ofaboth have dimensionr, withr basis vectors columns ofc and rows ofr. One minute : Why does R have independent rows? Look again at Example 4. A = 3 8 2 6 = 3 0 2 independent 2 rows ofr 0 ones and zeros It is those ones and zeros in R that tell me : No row is a combination of the other rows. The big factorization for data science is the SVD of A when the first factor C has r orthogonal columns and the second factor R has r orthogonal rows.

6 Highlights of Linear Algebra Problem Set I. Give an example where a combination of three nonzero vectors in R 4 is the zero vector. Then write your example in the form Ax = 0. What are the shapes of A and x and0? 2 Suppose a combination of the columns of A equals a different combination of those columns. Write that as Ax = Ay. Find two combinations of the columns of A that equal the zero vector (in matrix language, find two solutions to Az = 0). 3 (Practice with subscripts) The vectors a,a 2,...,a n are in m-dimensional space R m, and a combination c a + + c n a n is the zero vector. That statement is at the vector level. () Write that statement at the matrix level. Use the matrix A with the a s in its columns and use the column vectorc = (c,...,c n ). (2) Write that statement at the scalar level. Use subscripts and sigma notation to add up numbers. The column vectora j has componentsa j,a 2j,...,a mj. 4 Suppose A is the 3 by 3 matrix ones(3,3) of all ones. Find two independent vectors x and y that solve Ax = 0 and Ay = 0. Write that first equation Ax = 0 (with numbers) as a combination of the columns of A. Why don t I ask for a third independent vector with Az = 0? 5 The linear combinations ofv = (,,0) andw = (0,,) fill a plane in R 3. (a) Find a vector z that is perpendicular to v and w. Then z is perpendicular to every vectorcv +dw on the plane : (cv +dw) T z = cv T z +dw T z = 0+0. (b) Find a vectoruthat is not on the plane. Check thatu T z 0. 6 In the xy plane mark all nine of these linear combinations: 2 0 c +d with c = 0,,2 and d = 0,,2. 7 If three corners of a parallelogram are (,), (4,2), and (,3), what are all three of the possible fourth corners? Draw two of them. 8 How many corners does a cube have in 4 dimensions? How many 3D faces? How many edges? An edge goes between two adjacent corners. 9 Describe the column space of A = v w v +2w. Describe the nullspace of A : all vectorsx = (x,x 2,x 3 ) that solve Ax = 0. Add the dimensions of that plane (the column space ofa) and that line (the nullspace ofa) : dimension of column space + dimension of nullspace = number of columns

I.. MultiplicationAx Using Columns of A 7 0 Suppose the column space of anmbynmatrix is all of R 3. What can you say about m? What can you say aboutn? What can you say aboutr? Find the matricesc andc 2 containing independent columns ofa anda 2 : A = 3 2 3 9 6 2 6 4 A 2 = 2 3 4 5 6 7 8 9 2 Factor each of those matrices intoa = CR. The matrixrwill contain the numbers that multiply columns of C to recover columns of A. This is one way to look at matrix multiplication : C times each column ofr. 3 Produce a basis for the column spaces of A and A 2. What are the dimensions of those column spaces the number of independent vectors? What are the ranks of A anda 2? How many independent rows ina anda 2? 4 Create a 4 by4matrixaof rank2. What shapes arec andr? 5 Suppose two matrices A and B have the same column space. (a) Show that their row spaces can be different. (b) Show that the matricesc (basic columns) can be different. (c) What number will be the same foraandb? 6 IF A = CR, the first row of A is a combination of the rows of R. Which part of which matrix holds the coefficients in that combination the numbers that multiply the rows ofrto produce row ofa? 7 The rows of R are a basis for the row space of A. What does that sentence mean? 8 For these matrices with square blocks, find A = CR. What ranks? zeros ones A = ones ones 4 4 A A 2 = A 8 4 0 A 9 IfA = CR, what are the CR factors of the matrix 0 A A A A 3 = A A 8 8 20 Elimination subtracts a number l ij times row j from row i : a row operation. Show how those steps can reduce the matrix A in Example 4 to R (except that this row echelon form R has a row of zeros). The rank won t change! A = 3 8 2 6 R = 0 2 0 0 0? = rref(a).

8 Highlights of Linear Algebra This page is about the factorization A = CR and its close relative A = CMR. As before, C has r independent columns taken from A. The new matrix R has r independent rows, also taken directly from A. The r by r mixing matrix is M. This invertible matrix makes A = CM R a true equation. The rows of R (not bold) were chosen to produce A = CR, but those rows of R did not come directly from A. We will see that R has the form MR (bold R). Rank- example A = CR = CMR 2 4 3 6 2 2 2 = = 3 3 2 2 4 In this casem is justby. How do we findm in other examples ofa = CMR? C and R are not square. They have one-sided inverses. We need C T C and RR T. A=CMR CT AR T =C T C M RR T M=(C T C) (C T AR T )(RR T ) ( ) Here are extra problems to give practice with all these rectangular matrices of rank r. C T C andrr T have rankr so they are invertible (see the last page of Section I.3). 2 Show that equation ( ) producesm = 2 in the small example above. 22 The rank-2 example in the text produced A = CR in equation (2) : A = 3 8 2 6 = 3 2 0 0 2 = CR Choose rowsand2directly fromato go into R. Then from equation ( ), find the 2 by2matrixm that producesa = CMR. Fractions enter the inverse of matrices : Inverse of a 2 by2matrix a b c d = b 23 Show that this formula ( ) breaks down if d ad bc a = m c d b c a ( ) : dependent columns. 24 Create a 3 by2matrixawith rank. FactorAintoA = CR anda = CMR. 25 Create a 3 by2matrixawith rank2. FactorAintoA = CMR. The reason for this page is that the factorizationsa = CR anda = CMR have jumped forward in importance for large matrices. When C takes columns directly from A, and R takes rows directly from A, those matrices preserve properties that are lost in the more famous QR and SVD factorizations. Where A = QR and A = UΣV T involve orthogonalizing the vectors, C and R keep the original data : IfAis nonnegative, so arec andr. IfAis sparse, so arec andr.