Math Bootcamp An p-dimensional vector is p numbers put together. Written as. x 1 x =. x p

Similar documents
Introduction to Matrix Algebra

Knowledge Discovery and Data Mining 1 (VO) ( )

Review of Linear Algebra

Lecture 1 Review: Linear models have the form (in matrix notation) Y = Xβ + ε,

MATRIX ALGEBRA. or x = (x 1,..., x n ) R n. y 1 y 2. x 2. x m. y m. y = cos θ 1 = x 1 L x. sin θ 1 = x 2. cos θ 2 = y 1 L y.

Math Linear Algebra Final Exam Review Sheet

3 Matrix Algebra. 3.1 Operations on matrices

MATH 240 Spring, Chapter 1: Linear Equations and Matrices

Linear Algebra V = T = ( 4 3 ).

Preliminary Linear Algebra 1. Copyright c 2012 Dan Nettleton (Iowa State University) Statistics / 100

Linear Algebra Formulas. Ben Lee

2. Matrix Algebra and Random Vectors

Mathematical Foundations of Applied Statistics: Matrix Algebra

NOTES on LINEAR ALGEBRA 1

Linear Algebra Review. Vectors

Appendix A: Matrices

MATH2210 Notebook 2 Spring 2018

Elementary maths for GMT

CS 246 Review of Linear Algebra 01/17/19

EE731 Lecture Notes: Matrix Computations for Signal Processing

c c c c c c c c c c a 3x3 matrix C= has a determinant determined by

1 Matrices and matrix algebra

Phys 201. Matrices and Determinants

STAT200C: Review of Linear Algebra

Linear Algebra review Powers of a diagonalizable matrix Spectral decomposition

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

Linear Algebra Highlights

Basic Concepts in Matrix Algebra

ELE/MCE 503 Linear Algebra Facts Fall 2018

Chapter 1. Matrix Algebra

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

Recall the convention that, for us, all vectors are column vectors.

Foundations of Matrix Analysis

Linear Algebra review Powers of a diagonalizable matrix Spectral decomposition

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.

MATRICES AND MATRIX OPERATIONS

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

Quick Tour of Linear Algebra and Graph Theory

Quick Tour of Linear Algebra and Graph Theory

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

Matrices and Linear Algebra

4. Determinants.

ENGI 9420 Lecture Notes 2 - Matrix Algebra Page Matrix operations can render the solution of a linear system much more efficient.

Matrices. Chapter Definitions and Notations

IMPORTANT DEFINITIONS AND THEOREMS REFERENCE SHEET

IMPORTANT DEFINITIONS AND THEOREMS REFERENCE SHEET

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

Linear Algebra Primer

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

Materials engineering Collage \\ Ceramic & construction materials department Numerical Analysis \\Third stage by \\ Dalya Hekmat

Graduate Mathematical Economics Lecture 1

Undergraduate Mathematical Economics Lecture 1

Lecture Summaries for Linear Algebra M51A

TBP MATH33A Review Sheet. November 24, 2018

1. Linear systems of equations. Chapters 7-8: Linear Algebra. Solution(s) of a linear system of equations (continued)

Jim Lambers MAT 610 Summer Session Lecture 1 Notes

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

Matrices Gaussian elimination Determinants. Graphics 2009/2010, period 1. Lecture 4: matrices

Conceptual Questions for Review

NOTES FOR LINEAR ALGEBRA 133

Linear Algebra and Matrices

ECON 186 Class Notes: Linear Algebra

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

Math 315: Linear Algebra Solutions to Assignment 7

Math Camp Lecture 4: Linear Algebra. Xiao Yu Wang. Aug 2010 MIT. Xiao Yu Wang (MIT) Math Camp /10 1 / 88

OHSx XM511 Linear Algebra: Solutions to Online True/False Exercises

CP3 REVISION LECTURES VECTORS AND MATRICES Lecture 1. Prof. N. Harnew University of Oxford TT 2013

Linear Systems and Matrices

Quantum Computing Lecture 2. Review of Linear Algebra

Fundamentals of Engineering Analysis (650163)

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

1. In this problem, if the statement is always true, circle T; otherwise, circle F.

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

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

A Quick Tour of Linear Algebra and Optimization for Machine Learning

2. Linear algebra. matrices and vectors. linear equations. range and nullspace of matrices. function of vectors, gradient and Hessian

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

Lecture Notes in Linear Algebra

Matrix Algebra: Summary

A matrix is a rectangular array of. objects arranged in rows and columns. The objects are called the entries. is called the size of the matrix, and

18.06SC Final Exam Solutions

Matrices and Determinants

Review of Vectors and Matrices

A Brief Outline of Math 355

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.

A matrix is a rectangular array of. objects arranged in rows and columns. The objects are called the entries. is called the size of the matrix, and

Introduction to Matrices

Introduction Eigen Values and Eigen Vectors An Application Matrix Calculus Optimal Portfolio. Portfolios. Christopher Ting.

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

Determinants by Cofactor Expansion (III)

Linear Algebra - Part II

3 (Maths) Linear Algebra

Introduction to Quantitative Techniques for MSc Programmes SCHOOL OF ECONOMICS, MATHEMATICS AND STATISTICS MALET STREET LONDON WC1E 7HX

Matrix & Linear Algebra

Chapter 3 Transformations

Chapter 2 Notes, Linear Algebra 5e Lay

Elementary Linear Algebra

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

LINEAR ALGEBRA REVIEW

a 11 a 12 a 11 a 12 a 13 a 21 a 22 a 23 . a 31 a 32 a 33 a 12 a 21 a 23 a 31 a = = = = 12

Transcription:

Math Bootcamp 2012 1 Review of matrix algebra 1.1 Vectors and rules of operations An p-dimensional vector is p numbers put together. Written as x 1 x =. x p. When p = 1, this represents a point in the line. When p = 2 it represents a point in a plane; when p = 3, it represents a point in the 3-d space. For general p, this represents a point in a p-dimension Euclidean space, written as R p. Alternatively, it can also be interpreted as an arrow, or vector, starting from the origin, pointing to that point. The transpose operation changes a column vector to a row vector; and is written as x or x T ; that is x = (x 1,..., x p ). A number is also called a scalar. We can define the product between a vector x R p and a scalar, c R, as follows: x 1 cx 1 cx = c. =.. x p cx p Draw a picture here. We define addition of two vectors, x and y, as follows x 1 y 1 x 1 + y 1 x + y =. +. =. x p y p x p + y p Draw a picture here for interpretation. 1

1.2 Length and angle Suppose p = 2, then by Pythagoras theorem we know that the length of x = (x 1, x 2 ) is simply x 2 1 + x 2 2. We can extend this concept to arbitrary p. The length of a vector x R p is the length of the arrow from origin to that point: x = x 2 1 + + x 2 p Note that, for any scalar c R p, cx = c x. Now let us define the angle between two vectors. Again start with p = 2. Let θ be the angle between x and y. Let θ 1 be the angle between x and the horizontal axis and θ 2 be the angle between y and the horizontal axis. Then cos(θ 1 ) = x 1 x, cos(θ 2) = y 1 x, sin(θ 1) = x 2 x, sin(θ 2) = y 2 x, Now we can express the cosine of the angle θ in terms of x and y, as follows: cos(θ 2 θ 1 ) = cos(θ 2 ) cos(θ 1 ) + sin(θ 2 ) sin(θ 1 ) = x 1y 1 + x 2 y 2 x y. This formula is generalized to the p-dimensional case as cos(θ) = x 1y 1 + + x p y p. x y We call x 1 y 1 + + x p y p the inner product, or scalar product, between x and y, and write it as x T y; that is, In this notation, x T y = x 1 y 1 + + x p y p. cos(θ) = 2 xt y x y.

The number θ: ( ) x cos 1 T y x y is defined as the angle between two vectors x and y in R p. Example: Let 1. Find 3x, 2. Find x + y, 3. Find the lengths of x and y, x = (1, 3, 2), y = ( 2, 1, 1). 4. Find the cosine of the angle between x and y, 5. Find the angle between x and y. 6. Check that 3x = 3 x. Solution: 1. 3x = 3(1, 3, 2) = (3 1, 3 3, 3 2) = (3, 9, 6). 2. 3. x + y = (1, 3, 2) + ( 2, 1, 1) = (1 2, 3 + 1, 2 1) = ( 1, 4, 1). x = 1 2 + 3 2 + 2 2 = 14 = 3.742, y = ( 2) 2 + 1 2 + ( 1) 2 = 6 = 2.449. 4. Let θ be the angle between x and y. Then cos(θ) = (1)( 2) + (3)(1) + (2)( 1) 14 6 = 0.109 5. Now θ = cos 1 ( 0.109) = 1.680 = 96.26. 6. Obviously, they are the same. 3 x = 3 14, 3x = 3 2 (14). 3

1.3 Projection of a vector onto the direction of another vector Suppose we have two vectors, x, y R p. The vector x y(y y) 1 y is called the projection of x onto y. We write this as P y (x). Note that this vector is proportional to y. Then length of this projection is P y (x) = x y y y 2 = x y y = x y x = x cos(θ). x y 1.4 Linear independence A set of vectors x 1,..., x k are said to be linearly dependent, if there exist scalars c 1,..., c k, not all zero, such that c 1 x 1 + c k x k = 0. Interpretation: if k = 2, then this means two vectors are proportional to each other; that is, they are on the same line. When k = 3, this means the k points are in the same plane. The set of vectors {x 1,... x k } are linearly dependent if they are not linear independent. That is, if there does not exist c 1,..., c k, not all zero, such that the above holds. In other words, whenever the above holds, c 1 = = c k = 0. Interpretation, they do not reside in any lower dimensional hyperplane. Example: Are the following groups of vectors linearly dependent? 1. x 1 = (1, 2, 3), x 2 = (1, 1, 1), x 3 = (0, 0, 1) 2. x 1 = (1, 2, 3), x 2 = (1, 1, 1), x 3 = (1, 3, 5). 3. Illustrate your conclusions by vectors in a 3-dimensional space. Solution: 1. Suppose c 1 x 1 + c 2 x 2 + c 3 x 3 = 0. (1) Then c 1 1 1 0 2 + c 2 1 + c 3 0 = 0 3 1 1 4

This is equivalent to c 1 + c 2 = 0 (2) 2c 1 + c 2 = 0 (3) 3c 1 + c 2 + c 3 = 0 (4) From equation (2) we see that c 2 = c 1. Substitute this into equation (3) to obtain 2c 1 c 1 = c 1 = 0. Substitute this into (2) to show that c 2 = 0. Substitute c 1 = c 2 = 0 into 4 to show that c 3 = 0. Thus we have shown that whenever (1) holds we have that c 1 = c 2 = c 3 = 0. That is, x 1, x 2, x 3 are linearly independent. 2. Similarly, equation (1) implies that c 1 + 2c 2 + 3c 3 =0 (5) c 1 + c 2 + c 3 =0 (6) c 2 + 2c 3 =0 (7) From (7) we see that c 2 = 2c 3. Substitute this into (6) and (5) to obtain c 1 c 3 =0 c 1 c 3 =0 Thus equation (1) will be satisfied if c 1 = c 3 and c 2 = 2c 3. For example, if (c 1, c 2, c 3 ) = (1, 2, 1) the equation (1) is satisfied. Hence x 1, x 2, x 3 are linearly dependent. 3. Draw two pictures to illustrate whether the three points are on the lower dimensional space or not. 5

2 Matrices 2.1 Notations A matrix is a collection of numbers ordered by rows and columns. It is customary to enclose the elements of a matrix in parentheses, brackets, or braces. For example, the following is a matrix: ( ) 5 8 2 X =. 1 0 7 This matrix has two rows and three columns, so it is referred to as a 2 by 3 matrix. The elements of a matrix are numbered in the following way: ( ) x11 x X = 12 x 13. x 21 x 22 x 23 The first subscript in a matrix refers to the row and the second subscript refers to the column. x ij denotes the element on the ith row and jth column of matrix X. A square matrix has as many rows as it has columns. ( ) 1 3 A =. 6 2 A symmetric matrix is a square matrix in which x ij = x ji for all possible i and j. ( ) 1 3 A =. 3 2 A diagonal matrix is a square matrix where all the off diagonal elements are 0. A diagonal matrix is always symmetric. ( ) 1 0 A =. 0 2 An identity matrix is a diagonal matrix with 1s and only 1s on the diagonal. The p p identity matrix is almost always denoted as I p. 1 0 0 I 3 = 0 1 0. 0 0 1 6

2.2 Basic operations Matrix addition: to add two matrices, they both must have the same number of rows and they both must have the same number of columns. The elements of the two matrices are simply added together, element by element, to produce the results. Let A = {a ij } and B = {b ij } be two m n matrices, then (A + B) ij = a ij + b ij for 1 i m, 1 j n. ( ) ( ) ( ) 1 0 0 1 2 3 2 2 3 + =. 0 1 0 0 1 0 0 2 0 Matrix subtraction works in the same way. Scalar multiplication: each element in the product matrix is simply the scalar multiplied by the element in the matrix. Let c be a scalar and A be a m n matrix, then (ca) ij = ca ij for 1 i m, 1 j n. ( ) ( ) 1 0 0 2 0 0 2 =. 0 1 0 0 2 0 Scalar multiplication is commutative, or ca = Ac. Multiplication of a row vector and a column vector: the row vector must have as many columns as the column vector has rows. The product is a scalar. Let a 1 b = ( ) b 1 b p, a =., then b a = ( ) b 1 b p. = p i=1 b ia i. a 1 a p Multiplication of two matrices: multiplication of two matrices is defined only if the number of columns of the left matrix is the same as the number of rows of the right matrix. Let A be m p and B be p n, then (AB) ij = 7 p a il b lj l=1 a p

Let a i be the ith row vector of A. Let b j be the jth column vector of B. Then (AB) ij = a i b j (AB) i = a i B (AB) j = Ab j Some properties: 1. A + B = B + A (commutativity). 2. (ca)b = A(cB) (scalar associativity). 3. c(a + B) = ca + cb (scalar distributivity). 4. (AB)C = A(BC) (matrix associativity). 5. (A + B)C = AC + BC (matrix left distributivity). 6. C(A + B) = CA + CB (matrix right distributivity). 7. AI = A, IB = B. Generally, AB BA, or the commutative law doesn t apply to matrix multiplication. That is, if A is k k matrix and B is a k k matrix. Then both AB and BA are defined. But it may not be true that AB = BA. If this does hold then we say A and B commute. Matrix transpose: the transpose of a matrix A is denoted by A or A T. The first row of a matrix becomes the first column of the transpose matrix, the second row of the matrix becomes the second column of the transpose, etc. A ij = A ji. The transpose of a row vector will be a column vector, and the transpose of a column vector will be a row vector. The transpose of a symmetric matrix is simply the original matrix. Matrix inverse: the inverse of a matrix A is denoted by A 1. AA 1 = A 1 A = I. A matrix must be square to have an inverse, but not all square matrices have an inverse. In some cases, the inverse does not exist. 8

We say that A is nonsingular if it is invertible. We say A is singular if it is not invertible. A k k matrix A is invertible if and only if its columns, a 1,..., a k, are linearly independent. Trace of matrix: denoted as tr(a), the trace is used only for square matrices and equals the sum of the diagonal elements of the matrix. Let A be p p, then tr(a) = p i=1 a ii. 2.3 Determinant The determinant of A is denoted by det(a) or A. Some properties: 1. A matrix is invertible if and only if its determinant is nonzero. 2. The determinant of a product of square matrices equals the product of their determinants: det(ab) = det(a)det(b). 3. det(a 1 ) = [det(a)] 1, det(a ) = det(a). 4. Adding a multiple of any row to another row, or adding a multiple of any column to another column, does not change the determinant. 5. Interchanging two rows or two columns affects the determinant by multiplying it by -1. ( ) a b 6. The 2 2 matrix A = has determinant det(a) = ad bc. c d 7. The determinant det(a) can be viewed as the oriented area of the parallelogram with vertices at (0, 0), (a, b), (a+c, b+d), and (c, d). The oriented area is the same as the usual area, except that it is negative when the vertices are listed in clockwise order. Let A be a k k matrix. Its determinant is a number defined recursively as follows. Let A i, j be the (k 1) (k 1) matrix constructed by removing the ith row, jth column of the matrix A. 1. If k = 1; that is, if A is a number a, then det(a) = a; 9

2. For general k, suppose the (i, j)th element of A is a ij. Then det(a) = k a 1j det(a 1, j )( 1) 1+j. j=1 In fact, 1 can be replaced by any row label i, and the resulting numbers are all the same. Here det(a i, j ) is called the minor of a ij, and ( 1) i+j det(a i, j ) is called the cofactor of a ij, and is written as C ij. So the determinant of a matrix is the sum of each element of the first row of A multiplied by its cofactor. It is helpful to first see what ( 1) i+j means. This means whenever i + j is even, take + for the cofactor, whenever (i + j) is odd, take as for that cofactor. Thus, if we have a 2 2 matrix, the pattern is ( ) + + If we have a 3 3 matrix, then the sign pattern is + + + + + It is like a checker board with the first grid always colored white (meaning +). Example: Suppose A = ( 3). Then det(a) = 3. Suppose ( ) a11 a A = 12 a 21 a 22 Then So C 11 = a 22, C 12 = a 21. det(a) = a 11 a 22 + a 12 ( a 21 ). If A is a 3 3 matrix, then a 11 a 12 a 13 A = a 21 a 22 a 23 a 31 a 32 a 33 10

Then ( ) a22 a C 11 = + det 23, C a 32 a 12 = det 33 and More properties of determinant: ( a21 a 22 a 31 a 32 det(a) = a 11 C 11 + a 12 C 12 + a 13 C 13. ), C 13 = + det ( a21 a 22 a 31 a 32 1. If c is a number and A is k k matrix, then det(ca) = c k det(a). 2. If A is a square, diagonal matrix, then its determinant is the product of the diagonal elements. 3. The determinant of a square, symmetric matrix is the product of all eigenvalues of A. ). 11

3 Matrices (Day 3) 3.1 Rank The column rank of a matrix A is the maximum number of linearly independent column vectors of A. The row rank of a matrix A is the maximum number of linearly independent row vectors of A. The column rank and the row rank are always equal, and are called the rank of matrix A, denoted as rank(a). Some Properties: 1. Only a zero matrix has rank zero. 2. For A R m n, rank(a) min(m, n). 3. For A R n n, A in invertible if and only if rank(a) = n. 4. For A R m n, B R n k, rank(ab) min{rank(a), rank(b)}. 5. For A R m n, B R n k with rank(b) = n, then rank(ab) = rank(a). 6. rank(a + B) rank(a) + rank(b). 7. rank(a) = rank(a T ) = rank(aa T ) = rank(a T A). 3.2 Orthogonal matrix A square matrix Q is called an orthogonal matrix if QQ = Q Q = I. p p In other words, Q 1 = Q. In this case, if we write the columns of Q as q 1,..., q p, then we have q 1 Q Q =. q p ( q 1 q p ) = q 1q 1 q 1q p..... q pq 1 q pq p = I That is, q iq j = { 0 if i j 1 if i = j We say that that two vectors, a, b are orthogonal if a b = 0. This is because the cosine of their angle a b/( a b ) = 0. Thus the columns of an orthogonal matrix are orthogonal with length 1. Similarly, the rows of an orthogonal matrix are orthogonal with length 1. 12

3.3 Eigenvalues and Eigenvectors We say that a square matrix A has eigenvalue λ if there is a vector x 0 p p p 1 such that Ax = λx. The vector x is called an eigenvector of A associated with λ. Note that the above is unchanged if we multiply both sides by a none zero constant. So we can multiply both sides of the equality by 1/ x, so that, the convention of eigenvector is that it has length 1. To find eigenvalues of A such that Ax = λx, we set the characteristic function equal to 0, and solve det(a λi) = 0. A k k symmetric matrix A has k pairs of eigenvalues and eigenvectors: (λ 1, e 1 ),..., (λ k, e k ). Furthermore, e 1,..., e k can always be chosen so that { e 0 if i j ie j = 1 if i = j That is, they are orthogonal and have length 1. Such a set of vectors is called an orthonormal set of vectors. If (λ 1, e 1 ),..., (λ k, e k ) are the k eigenpairs of the matrix A, then the k k following equality holds: A = λ 1 e 1 e 1 + + λ k e k e k. This is called the spectral decomposition of A, or eigen decomposition of A. Denote Λ as a diagonal matrix with diagonal elements Λ ii = λ i. Denote E with the ith column being e i. Then we have eigenvalue decomposition of A as A = EΛE T. 13

3.4 Power of a matrix Let A be a k k square, symmetric matrix, and let (λ 1, e 1 ),..., (λ k, e k ) be the eigen pairs of A. Let α be a number. The following k k matrix λ α 1 e 1 e 1 + + λ α k e k e k is called the αth power of A. Notice that when 0 α < 1, the above is defined only when λ 1,..., λ k are nonnegative. This is written as A α. In particular, if λ 1 0,... λ k 0 and α = 1/2, then A 1/2 is called the square root of the matrix A. The matrix A raised to the power 1 is the same as the inverse of a matrix. 3.5 System of equations Consider solving for x and y in { 3x y = 7 2x + 3y = 1 Denote Then A = A ( ) 3 1 2 3 ( ) x = y ( ) 7 1 Pre-multiply both sides by A 1, we get ( ) ( ) ( ) ( ) x 7 3/11 1/11 7 = A 1 = = y 1 2/11 3/11 1 ( ) 2 1 14