Unformatted text preview:

Cogsci 109 Virginia de Sa Linear Algebra Review There is a free text book at Free on line Linear Algebra text 1 Vectors x x1 x2 xn 2 e g 3 3 x 2 5 x3 5 x2 2 3 x1 Vector Arithmetic Addition To add two vectors together add them componentwise v1 3 2 5 v1 3 2 5 v2 1 3 2 v2 1 3 2 4 v1 v2 ans 4 5 7 from http www pa uky edu phy211 VecArith index html off line vector addition demo Created designed and compiled by Vladimir Sorokin 1997 on line demo 5 6 Scaling a vector z x for a scalar then 3 3 z 2 2 5 5 This is just like stretching shrinking the vector by a factor 7 Matrices A matrix is an N M element array A a11 a12 a1m a21 aN 1 aN M transpose of matrix A written AT is aji A with rows and columns flipped Transpose in Matlab In Matlab use A A 1 2 3 4 A 1 3 2 4 A ans 1 2 3 4 A square matrix is symmetric iff A AT 8 Linear Transformations A function f is a linear transformation if f ax by af x bf y Matrix multiplication A BC means aij N X bik ckj k 1 For multiplication to be defined B must have the same number of columns as C has rows m n n p m p In Matlab use A B C 9 Matrix Multiplication Example B C A 1 2 3 3 2 1 4 5 10 2 a11 a12 a21 a22 2 10 10 Matrix Multiplication Example 1 2 3 3 2 1 4 5 10 2 a11 a12 a21 a22 2 10 11 Matrix Multiplication Example 1 2 3 3 2 1 4 5 10 2 a11 a12 a21 a22 2 10 a11 1 4 12 Matrix Multiplication Example 1 2 3 3 2 1 4 5 10 2 a11 a12 a21 a22 2 10 a11 1 4 2 10 13 Matrix Multiplication Example 1 2 3 3 2 1 4 5 10 2 30 a12 a21 a22 2 10 a11 1 4 2 10 3 2 30 14 Matrix Multiplication Example 1 2 3 3 2 1 4 5 10 2 30 39 a21 a22 2 10 a12 1 5 2 2 3 10 39 15 Matrix Multiplication Example 1 2 3 3 2 1 4 5 10 2 30 39 34 a22 2 10 a21 3 4 2 10 1 2 34 16 Matrix Multiplication Example 1 2 3 3 2 1 4 5 10 2 30 39 34 29 2 10 a22 3 5 2 2 1 10 29 17 Inverse of a Matrix AA 1 I where I 1 0 0 0 1 1 0 0 0 1 18 19 in Matlab use inv A A 1 2 3 4 A 1 3 2 4 inv A ans 2 0000 1 5000 1 0000 0 5000 a matrix A is orthogonal if AT A 1 and in this case AAT I Dot Product of two vectors a b n X aibi atb i 1 0 1 2 3 4 5 0 3 1 4 2 5 14 In matlab use sum a b a 1 2 3 a 1 2 b 2 3 4 3 20 21 b 2 3 4 sum a b ans 20 a b cos k a k k b k a b k b k b a k a k where a b is the signed component of a along b a a b cos a b a b If two vectors are orthogonal then their dot product is 0 and cos 0 or 90 deg off line demo on line demo 22 Matrix Transformation Multiplying a vector x by a matrix y Ax transforms x to a new vector y which may have a different number of dimensions if A is not square We can talk about different properties that the transformation given by A represents rotation matrix is given by A cos sin sin cos So to rotate vector 1 0 by 30 deg we multiply 8660 5 5 8660 1 0 8660 5 23 8660 5 30 1 0 Rotation matrices are orthogonal 8660 5 5 8660 T 8660 5 5 8660 1 0 0 1 This makes sense because to invert a rotation of angle we want to rotate by and since cos cos and sin sin the inverse of a rotation matrix is the transpose try it Eigenvalues and Eigenvectors When a Matrix multiplies a vector in general the direction and magnitude of the vector will change BUT there are special vectors where only the magnitude changes on multiplication by a square Matrix These are called eigenvectors The value by which the length changes is the associated eigenvalue We say that x is an eigenvector of square matrix A iff Ax x In other words x is an eigenvector if when you multiply it by A it returns a multiple of itself is called the associated eigenvalue on line demo 24 Eigenvalues and Eigenvectors in Matlab In Matlab use V D eig A to get a matrix V whose columns are the eigenvectors of A and a diagonal matrix D whose entries on the diagonal are the corresponding eigenvalues AV VD A A 1 3 2 4 V D eig A V 0 8246 0 5658 0 4160 0 9094 25 26 D 0 3723 0 0 5 3723 Positive Definite Matrices a symmetric matrix A is positive definite if for every x xtAx 0 and positive semi definite if xtAx 0 symmetric positive definite matrices have all their eigenvalues positive There are some great on line lectures by Gilbert Strang Strang lectures 27


View Full Document

UCSD COGS 109 - Linear Algebra Review

Documents in this Course
Load more
Loading Unlocking...
Login

Join to view Linear Algebra Review and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Linear Algebra Review and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?