linear algebra a gentle introduction

21
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 : “shiv rpi Linear Algebra A gentle introduction Linear Algebra has become as basic and as applicable as calculus, and fortunately it is easier. --Gilbert Strang, MIT

Upload: hunter-stark

Post on 02-Jan-2016

56 views

Category:

Documents


4 download

DESCRIPTION

Linear Algebra A gentle introduction. Linear Algebra has become as basic and as applicable as calculus, and fortunately it is easier. --Gilbert Strang, MIT. What is a Vector ?. Think of a vector as a directed line segment in N-dimensions ! (has “length” and “direction”) - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Linear Algebra  A gentle introduction

Shivkumar KalyanaramanRensselaer Polytechnic Institute

1 : “shiv rpi”

Linear Algebra A gentle introduction

Linear Algebra has become as basic and as applicable as calculus, and fortunately it is easier.

--Gilbert Strang, MIT

Page 2: Linear Algebra  A gentle introduction

Shivkumar KalyanaramanRensselaer Polytechnic Institute

2 : “shiv rpi”

What is a Vector ? Think of a vector as a directed line

segment in N-dimensions! (has “length” and “direction”)

Basic idea: convert geometry in higher dimensions into algebra! Once you define a “nice” basis along

each dimension: x-, y-, z-axis … Vector becomes a N x 1 matrix! v = [a b c]T

Geometry starts to become linear algebra on vectors like v!

c

b

a

v

x

y

v

Page 3: Linear Algebra  A gentle introduction

Shivkumar KalyanaramanRensselaer Polytechnic Institute

3 : “shiv rpi”

Vector Addition: A+B

A

B

A

B

C

A+B = C(use the head-to-tail method

to combine vectors)

A+B

Page 4: Linear Algebra  A gentle introduction

Shivkumar KalyanaramanRensselaer Polytechnic Institute

4 : “shiv rpi”

Scalar Product: av

),(),( 2121 axaxxxaa v

vv

avav

Change only the length (“scaling”), but keep direction fixed.

Sneak peek: matrix operation (Av) can change length, direction and also dimensionality!

Page 5: Linear Algebra  A gentle introduction

Shivkumar KalyanaramanRensselaer Polytechnic Institute

5 : “shiv rpi”

Vectors: Dot Product

T

d

A B A B a b c e ad be cf

f

2 TA A A aa bb cc

)cos(BABA

Think of the dot product as a matrix multiplication

The magnitude is the dot product of a vector with itself

The dot product is also related to the angle between the two vectors

Page 6: Linear Algebra  A gentle introduction

Shivkumar KalyanaramanRensselaer Polytechnic Institute

6 : “shiv rpi”

Inner (dot) Product: v.w or wTv

vv

ww

22112121 .),).(,(. yxyxyyxxwv

The inner product is a The inner product is a SCALAR!SCALAR!

cos||||||||),).(,(. 2121 wvyyxxwv

wvwv 0.

If vectors v, w are “columns”, then dot product is wTv

Page 7: Linear Algebra  A gentle introduction

Shivkumar KalyanaramanRensselaer Polytechnic Institute

7 : “shiv rpi”

Projection: Using Inner Products (I)

p = a (aTx)||a|| = aTa = 1

Page 8: Linear Algebra  A gentle introduction

Shivkumar KalyanaramanRensselaer Polytechnic Institute

8 : “shiv rpi”

Bases & Orthonormal Bases

Basis (or axes): frame of reference

vs

Basis: a space is totally defined by a set of vectors – any point is a linear combination of the basis

Ortho-Normal: orthogonal + normal

[Sneak peek: Orthogonal: dot product is zeroNormal: magnitude is one ]

0

0

0

zy

zx

yx T

T

T

z

y

x

100

010

001

Page 9: Linear Algebra  A gentle introduction

Shivkumar KalyanaramanRensselaer Polytechnic Institute

9 : “shiv rpi”

What is a Matrix?

A matrix is a set of elements, organized into rows and columns

dc

barows

columns

Page 10: Linear Algebra  A gentle introduction

Shivkumar KalyanaramanRensselaer Polytechnic Institute

10 : “shiv rpi”

Basic Matrix Operations Addition, Subtraction, Multiplication: creating new matrices (or functions)

hdgc

fbea

hg

fe

dc

ba

hdgc

fbea

hg

fe

dc

ba

dhcfdgce

bhafbgae

hg

fe

dc

ba

Just add elements

Just subtract elements

Multiply each row by each column

Page 11: Linear Algebra  A gentle introduction

Shivkumar KalyanaramanRensselaer Polytechnic Institute

11 : “shiv rpi”

Matrix Times Matrix

NML

333231

232221

131211

333231

232221

131211

333231

232221

131211

nnn

nnn

nnn

mmm

mmm

mmm

lll

lll

lll

3 21 32 21 21 21 11 2 nmnmnml

Page 12: Linear Algebra  A gentle introduction

Shivkumar KalyanaramanRensselaer Polytechnic Institute

12 : “shiv rpi”

Multiplication Is AB = BA? Maybe, but maybe not!

Matrix multiplication AB: apply transformation B first, and then again transform using A!

Heads up: multiplication is NOT commutative!

Note: If A and B both represent either pure “rotation” or “scaling” they can be interchanged (i.e. AB = BA)

......

...bgae

hg

fe

dc

ba

......

...fcea

dc

ba

hg

fe

Page 13: Linear Algebra  A gentle introduction

Shivkumar KalyanaramanRensselaer Polytechnic Institute

13 : “shiv rpi”

Matrix operating on vectors Matrix is like a function that transforms the vectors on a plane Matrix operating on a general point => transforms x- and y-components System of linear equations: matrix is just the bunch of coeffs !

x’ = ax + by y’ = cx + dy

'

'

y

x

dc

ba

y

x

Page 14: Linear Algebra  A gentle introduction

Shivkumar KalyanaramanRensselaer Polytechnic Institute

14 : “shiv rpi”

Direction Vector Dot Matrix

cbav zyx vvv

0 0 0 1 1

x x x x x

y y y y y

z z z z z

x x x y x z x

y x y y y z y

z x z y z z z

a b c d v

a b c d v

a b c d v

v v a v b v c

v v a v b v c

v v a v b v c

v M v

Page 15: Linear Algebra  A gentle introduction

Shivkumar KalyanaramanRensselaer Polytechnic Institute

15 : “shiv rpi”

Inverse of a Matrix Identity matrix:

AI = A Inverse exists only for square

matrices that are non-singular Maps N-d space to another

N-d space bijectively Some matrices have an

inverse, such that:AA-1 = I

Inversion is tricky:(ABC)-1 = C-1B-1A-1

Derived from non-commutativity property

100

010

001

I

Page 16: Linear Algebra  A gentle introduction

Shivkumar KalyanaramanRensselaer Polytechnic Institute

16 : “shiv rpi”

Determinant of a Matrix Used for inversion If det(A) = 0, then A has no inverse

dc

baA bcadA )det(

ac

bd

bcadA

11

http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/threeD/index.htm

Page 17: Linear Algebra  A gentle introduction

Shivkumar KalyanaramanRensselaer Polytechnic Institute

17 : “shiv rpi”

Transpose of a Matrix

Written AT (transpose of A)

Keep the diagonal but reflect all other elements about the diagonal

aij = aji where i is the row and j the column in this example, elements c and b were exchanged For orthonormal matrices A-1 = AT

dc

baA T a c

Ab d

Page 18: Linear Algebra  A gentle introduction

Shivkumar KalyanaramanRensselaer Polytechnic Institute

18 : “shiv rpi”

Vectors: Cross Product The cross product of vectors A and B is a vector C which is

perpendicular to A and B The magnitude of C is proportional to the sin of the angle

between A and B The direction of C follows the right hand rule if we are

working in a right-handed coordinate system

)sin(BABA B

A

A×B

Page 19: Linear Algebra  A gentle introduction

Shivkumar KalyanaramanRensselaer Polytechnic Institute

19 : “shiv rpi”

MAGNITUDE OF THE CROSS PRODUCT

Page 20: Linear Algebra  A gentle introduction

Shivkumar KalyanaramanRensselaer Polytechnic Institute

20 : “shiv rpi”

DIRECTION OF THE CROSS PRODUCT

The right hand rule determines the direction of the cross product

Page 21: Linear Algebra  A gentle introduction

Shivkumar KalyanaramanRensselaer Polytechnic Institute

21 : “shiv rpi”

For more details Prof. Gilbert Strang’s course videos: http://ocw.mit.edu/OcwWeb/Mathematics/18-06Spring-2005/V

ideoLectures/index.htm

Esp. the lectures on eigenvalues/eigenvectors, singular value decomposition & applications of both. (second half of course)

Online Linear Algebra Tutorials: http://tutorial.math.lamar.edu/AllBrowsers/2318/2318.asp