A Geometric Review of Linear Algebra

Similar documents
A Geometric Review of Linear Algebra

Review of Matrices and Vectors 1/45

Roberto s Notes on Linear Algebra Chapter 1: Geometric vectors Section 8. The dot product

LECTURE 2: CROSS PRODUCTS, MULTILINEARITY, AND AREAS OF PARALLELOGRAMS

Mon Apr dot product, length, orthogonality, projection onto the span of a single vector. Announcements: Warm-up Exercise:

Scalar multiplication and algebraic direction of a vector

UNDERSTAND MOTION IN ONE AND TWO DIMENSIONS

Math 425 Lecture 1: Vectors in R 3, R n

Image Registration Lecture 2: Vectors and Matrices

Least Squares Optimization

Least Squares Optimization

Least Squares Optimization

Mathematics for Graphics and Vision

Linear Algebra Review. Vectors

CS123 INTRODUCTION TO COMPUTER GRAPHICS. Linear Algebra 1/33

Conceptual Questions for Review

Math 416, Spring 2010 More on Algebraic and Geometric Properties January 21, 2010 MORE ON ALGEBRAIC AND GEOMETRIC PROPERTIES

CHAPTER 3 : VECTORS. Definition 3.1 A vector is a quantity that has both magnitude and direction.

The geometry of least squares

Linear Algebra and Robot Modeling

Math Linear Algebra Final Exam Review Sheet

CS123 INTRODUCTION TO COMPUTER GRAPHICS. Linear Algebra /34

The Dot Product

Vectors in R n. P. Danziger

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

different formulas, depending on whether or not the vector is in two dimensions or three dimensions.

A Review of Linear Algebra

Lesson 3: Free fall, Vectors, Motion in a plane (sections )

ES.1803 Topic 16 Notes Jeremy Orloff

Unit 11: Vectors in the Plane

2) If a=<2,-1> and b=<3,2>, what is a b and what is the angle between the vectors?

We use the overhead arrow to denote a column vector, i.e., a number with a direction. For example, in three-space, we write

NOTES ON LINEAR ALGEBRA CLASS HANDOUT

Linear Algebra V = T = ( 4 3 ).

Astrometric Errors Correlated Strongly Across Multiple SIRTF Images

6.1.1 Angle between Two Lines Intersection of Two lines Shortest Distance from a Point to a Line

Linear Algebra. Ben Woodruff. Compiled July 17, 2010

1 :: Mathematical notation

Linear Algebra Massoud Malek

Review: Linear and Vector Algebra

Solutions to Selected Questions from Denis Sevee s Vector Geometry. (Updated )

Status: Unit 2, Chapter 3

Span and Linear Independence

General Lorentz Boost Transformations, Acting on Some Important Physical Quantities

LINEAR ALGEBRA. and VECTOR GEOMETRY Volume 2 of 2 September 2014 edition

4.1 Distance and Length

Differential Geometry of Surfaces

Vector Geometry. Chapter 5

Vectors and Matrices

Lecture 3: Linear Algebra Review, Part II

Designing Information Devices and Systems II

Linear Algebra, Summer 2011, pt. 2

Matrix Algebra: Vectors

Linear Algebra I. Ronald van Luijk, 2015

Physics 2A Chapter 3 - Motion in Two Dimensions Fall 2017

DS-GA 1002 Lecture notes 0 Fall Linear Algebra. These notes provide a review of basic concepts in linear algebra.

Linear Algebra March 16, 2019

Math 3191 Applied Linear Algebra

Review of Linear Algebra

DS-GA 1002 Lecture notes 10 November 23, Linear models

. = V c = V [x]v (5.1) c 1. c k

Rotational motion of a rigid body spinning around a rotational axis ˆn;

8.0 Definition and the concept of a vector:

Review of Linear Systems Theory

Notes on Linear Minimum Mean Square Error Estimators

(arrows denote positive direction)

GEOMETRY OF MATRICES x 1

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

MATH 12 CLASS 2 NOTES, SEP Contents. 2. Dot product: determining the angle between two vectors 2

Deep Learning Book Notes Chapter 2: Linear Algebra

LECTURE 1: INTRODUCTION, VECTORS, AND DOT PRODUCTS

Lecture 2: Vector-Vector Operations

This appendix provides a very basic introduction to linear algebra concepts.

Lecture 7. Econ August 18

Dot Products. K. Behrend. April 3, Abstract A short review of some basic facts on the dot product. Projections. The spectral theorem.

Singular Value Decomposition. 1 Singular Value Decomposition and the Four Fundamental Subspaces

Chapter 3 Motion in a Plane

4 ORTHOGONALITY ORTHOGONALITY OF THE FOUR SUBSPACES 4.1

Introduction to Matrix Algebra

Review of Linear System Theory

1 Linearity and Linear Systems

Linear Algebra Homework and Study Guide

Linear Algebra Primer

Linear Algebra - Part II

Chapter 8. Rigid transformations

Math 144 Activity #9 Introduction to Vectors

Matrices and Vectors. Definition of Matrix. An MxN matrix A is a two-dimensional array of numbers A =

The study of linear algebra involves several types of mathematical objects:

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

Chapter 2 - Vector Algebra

MOTION IN 2-DIMENSION (Projectile & Circular motion And Vectors)

Chapter 3 Transformations

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

14 Singular Value Decomposition

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

Numerical Methods I Solving Square Linear Systems: GEM and LU factorization

Applied Linear Algebra in Geoscience Using MATLAB

Maths for Signals and Systems Linear Algebra for Engineering Applications

Linear Algebra, Summer 2011, pt. 3

CS6964: Notes On Linear Systems

Transcription:

A Geometric Reiew of Linear Algebra The following is a compact reiew of the primary concepts of linear algebra. I assume the reader is familiar with basic (i.e., high school) algebra and trigonometry. The order of presentation is unconentional, with emphasis on geometric intuition rather than mathematical formalism. For a gentler introduction, I recommend The Appendix on Linear Algebra from the PDP book series, by Michael Jordan. For more thorough coerage, I recommend Linear Algebra and Its Applications by Gilbert Strang, Academic Press, 1980. Vectors (Finite-Dimensional) A ector is an ordered collection of numbers, known as the components of the ector. I ll use the ariable N throughoutto representthe number of components, knownas the dimensionality of the ector. We usually denote ector-alued ariables with an oer-arrow (e.g., ). If we want to indicate the components, we often arrange them ertically (as a column ector): 1 2 =. N, 3 Vectors of dimension 2 or 3 can be graphically depicted as arrows, with the tail at the origin and the head at the coordinate location specified by the ector components. Vectors of higher dimension can be illustrated using a spike plot. 2 1 2 1 1 2 N The norm (or magnitude) of a ector is defined as: = n 2 n, which has a alue that is positie. Geometrically, this corresponds to the length of the ector (in 2 dimensions, this comes from the Pythagorean theorem). A ector containing all zero components has zero Author: Eero Simoncelli, Center for Neural Science, and Courant Institute of Mathematical Sciences. Created: 20 January 1999. Last reised: October 5, 2017. Send corrections or comments to eero.simoncelli@nyu.edu The latest ersion of this document is aailable from: http://www.cns.nyu.edu/ eero/notes/

norm, and is called the zero ector. A unit ector is a ector of length one. In two dimensions, the set of all unit ectors may be parameterized in terms of their angle relatie to the horizontal axis: û(θ) = ( cos(θ) sin(θ) ). sinθ u^ Angular parameterization of unit ectors can be generalized to N dimensions, but is much messier. θ cosθ Multiplying a ector by a scalar simply changes the length of the ector by that factor. That is: a = a. Multiplying by a negatie number reerses the direction. The set of ectors corresponding to all rescalings of a gien ector form a straight line through the origin. Any ector (with the exception of the zero ector!) may be rescaled to hae unit length by diiding by its norm: ˆ = /. Said differently, any ector may be factorized into a product of a scalar (its norm) and a unit ector (which characterizes its direction): = ˆ. 2 The sum of two ectors of the same dimensionality is a ector whose components are sums of the corresponding components of the summands. Specifically, y = w + means that: z n = w n + n, for eery n w translated w Geometrically, this corresponds to stacking the ectors head-to-foot. The inner product (also called the dot product ) of two ectors is the sum of the pairwise product of components: w n w n. n 2

Note that the result is a scalar. This operation has an equialent geometric definition, which allows for a more intuitie, geometric, interpretation: ø w w w w cos (φ w ), where φ w is the angle between the two ectors. This is easy to proe in two dimensions: write the two ectors as re-scaled unit ectors, write the unit ectors in terms of their angle (as aboe), and then use the trig identity cos(θ w )cos(θ )+sin(θ w )sin(θ ) = cos(θ w θ ). This cosine is equal to b/ in the figure to the right. b w. b w. w. Note that the inner product of two perpendicular ectors is 0, the inner product of two parallel ectors is the product of their norms, and the inner product of a ector with itself is the square of its norm. From the definition, you should be able to conince yourself that the inner product is distributie oer addition: ( w+ y) = w+ y. And similarly, the inner product is also commutatie (i.e., order doesn t matter): w = w. Despite this symmetry, it is often useful to interpret one of the ectors in an inner product as an operator, that is applied to an input. For example, the inner product of any ector with the ector: w =( 1 1 1 N N N 1 N ) gies the aerage of the components of. The inner product of ector with the ector w =(100 0) 3

is the first component, 1. The inner product of a ector with a unit ector û has a particularly useful geometric interpretation. The cosine equation implies that the inner product is the length of the component of lying along the line in the direction of û. This component, which is written as ( û)û,isreferredtoastheprojection of the ector onto the line. The difference (or residual) ector, ( û)û, is the component of perpendicular to the line. Note that the residual ector is always perpendicular to the projection ector, and that their sum is [proe]. u^ (. u^ ) u^ Vector Spaces Vectors lie in ector spaces. Formally, a ector space is just a collection of ectors that is closed under linear combination. That is, if the two ectors {, w} are in the space, then the ector a + b w (with a and b any scalars) must also be in the space. All ector spaces include the zero ector (since multiplying any ector by the scalar zero gies you the zero ector). A subspace is a ector space lying within another ector space (think of a plane, slicing through the 3D world that we inhabit). This definition is somewhat abstract, as it implies that we construct ector spaces by starting with a few ectors and filling out the rest of the space through linear combination. But we hae been assuming an implicit ector space all along: the space of all N-ectors (denoted IR N ) 4

is clearly a ector space [erify]. Working backwards, a set of ectors is said to span a ector space if one can write any ector in the ector space as a linear combination of the set. A spanning set can be redundant: For example, if two of the ectors are identical, or are scaled copies of each other. This redundancy is formalized by defining linear independence. A set of ectors { 1, 2,... M } is linearly independent if (and only if) the only solution to the equation α n n =0 n 1 2 3 is α n =0(for all n). A basis for a ector space is a linearly independent spanning set. For example, consider the plane of this page. One ector is not enough to span the plane: Scalar multiples of this ector will trace out a line (which is a subspace), but cannot get off the line to coer the rest of the plane. But two ectors are sufficient to span the entire plane. Bases are not unique: any two ectors will do, as long as they don t lie along the same line. Three ectors are redundant: one can always be written as a linear combination of the other two. In general, the ector space R N requires a basis of size N. 1 2 2 1 1 Geometrically, the basis ectors define a set of coordinate axes for the space (although they need not be perpendicular). The standard basis is the set of unit ectors that lie along the axes of the space: 2ê 1 0 0 0 1 0 ê 1 =, ê 2 = 0. 0.,... ê N =. 0. 0 0 1 5 1ê

Linear Systems & Matrices A linear system S transforms ectors in one ector space into those of another ector space, in such a way that it obeys the principle of superposition: S{a + b w} = as{ } + bs{ w}. x a + S y b That is, the system response to any linear combination of ectors is equal to that same linear combination of the response to each of the ectors alone. Linear systems are useful because they are ery well understood (in particular, there are powerful tools for characterizing, analyzing and designing them), and because they proide a reasonable description of many physical systems. x y S S a b + The parallel definitions of ector space and linear system allow us to make a strong statement about characterizing linear systems. First, write an arbitrary input ector in terms of the standard basis: = 1 ê 1 + 2 ê 2 +...+ n ê N Using the linearity of system S, wewrite: S{ } = S{ 1 ê 1 + 2 ê 2 +...+ n ê N } = 1 S{ê 1 } + 2 S{ê 2 } +...+ n S{ê N }. 6

Input That is, the response is a linear combination of the responses to each of the standard basis ectors. Each of these responses is a ector. Since this holds for any input ector, the system is fully characterized by this set of response ectors. 1 x 2 x 3 x 4 x L 1 x 2 x 3 x 4 x Output We can gather the column ectors corresponding to the responses to each axis ector into a table of numbers that we call a matrix. This matrix is a complete representation of the associated linear system: any response is just a linear combination (weighted sum) of the columns of the matrix. Label the elements of the matrix S nm with n indicating the row and m the column. The response of the linear system to an input ector has components w n = m S nm m The summation is oer the columns of the matrix. For short, we write w = S, andreferto this as multiplication of the matrix by the input ector. The operation is only defined when the number of columns in the matrix matches the dimensionality of the input ector. An alternatie interpretation of the matrix multiplication is that each component of the output ector is an inner product of the corresponding row of the matrix with the input ector [conince yourself that this is true]. 4 7 6 1 66 3......... 5. =..... 2..... 7. Like ectors, matrices can be multiplied by a scalar and added (element by element). In addition, the transpose is another matrix with rows and columns swapped: (S T ) nm = S mn.a symmetric matrix is a square matrix that is equal to its transpose. The sequential application of two linear systems is a linear system. We define the matrix associated with the full system as the matrix product of the two subsystem matrices. Let A 7

and B be the two subsystem matrices. By following the transformation of the standard basis as it passes through A and then B, we can get a definition for the product matrix C: C nk = m B nm A mk The columns of the product matrix are just the application of matrix B to the columns of A. Since it can be thought of as a collection of inner products, matrix multiplication is distributie oer addition. It is also associatie: A(BC) = (AB)C. But be careful: It is generally not commutatie. Now consider two special classes of matrix. A diagonal matrix is one for which only elements along the diagonal can be non-zero. These matrices operate on ector spaces by stretching or compressing axes: the nth axis of the space is stretched or compressed by an amount specified by the nth diagonal element, S nn. The product of two diagonal matrices is diagonal. If the matrix is square, and the diagonal elements are all one, the matrix does nothing. This matrix is called the identity, denoted I. If an element of the diagonal is zero, then the associated axis is annihilated. The set of ectors that are annihilated by the matrix form a ector space [proe], which is called the row nullspace, orsimplythenullspace of the matrix. 2 0 [ ] 0 0 2 1 2 1 Another implication of a zero diagonal element is that the matrix cannot reach the entire output space, but only a proper subspace. This space is called the column space of the matrix, since it is spanned by the matrix columns. The rank of a matrix is just the dimensionality of the column space. A matrix is said to hae full rank if its rank is equal to the smaller of its two 8

dimensions. An orthogonal matrix is a square matrix, for which eery column is a unit ector, and eery pair of columns is orthogonal. This means that the transpose of the matrix multiplied by itself gies the identity matrix: O T O = I [proe]. This means that applying an orthogonal matrix to a ector does not change its length: O 2 = (O ) T (O ) = T O T O = T = 2. Similarly, applying an orthogonal matrix to two ectors does not change the angle between them [proe]. Since the columns of a matrix describe the response of the system to the standard basis, an orthogonal matrix maps the standard basis onto a new set of N orthogonal axes, which form an alternatie basis for the space. Putting this all together, we can think of orthognal matrices as performing a generalized rotation: a rigid physical rotation of the space and possibly negation of some axes. Note that the product of two orthogonal matrices is also orthogonal. Linear Systems of Equations The classic motiation for the study of linear algebra is the solution of sets of linear equations such as a 11 1 + a 12 2 +...+ a 1N N = b 1 a 21 1 + a 22 2 +...+ a 2N N = b 2 a M1 1 + a M2 2 +...+ a MN N = b M If we put the ariables n and the constants b m into column ectors, and the constants a nm into amatrixa, these equations may be written more compactly: A = b.furthermore,wemay now use the tools of linear algebra to determine if there is a solution for.. Inerses What if we want to inert the action of a matrix? That is: gien any output ector w, find the unique ector for which S = w. If the matrix has a (nonzero) nullspace, then this is impossible. In particular, all ectors in the nullspace are mapped to 0, so gien output w =0 9

we cannot determine from which ector in the nullspace we started. More generally, a ector satisfying S = w is not unique, since ( + n) also satisfies the expression (where n is chosen as any ector in the nullspace). If a matrix has a zero nullspace, then it can be inerted. The inerse operation has an associated matrix, denoted S 1. Since applying the matrix and its inerse in succession restore the original ector, the matrix product of the inerse and the matrix should be the identity: S 1 S = I. For example, the inerse of a square diagonal matrix is another diagonal matrix. Since the original matrix stretches and compresses axes, its inerse must undo these actions by multiplying each axis by the scalar inerse of the original stretch factor. Specifically, the inerse is a diagonal matrix with elements Snn 1 =1/S nn. Note that this cannot be done for diagonal elements equal to zero. Orthogonal matrices also hae simple inerses. Because of the orthogonality of the matrix columns, the transpose of an orthogonal matrix is its inerse: O T O = I. SinceO corresponds to a generalized rotation of the space, O T must correspond to a generalized rotation in the opposite direction. Finally, we e neglected non-square matrices. First, consider short and fat matrices, which project a ector space onto a space of smaller dimensionality. These cannot be inerted. Suppose the inerse matrix S 1 were to exist. Apply it to the standard basis ectors. This produces a set of ectors back in the input space of S. The span of these ectors is the column space of S 1. But this space has dimensionality equal to that of the output space of S, whichweassumed was smaller than that of the input space of S. Thus, our inerse cannot reach all the ectors in the input space of S. A tall and skinny matrix embeds a ector space into one of higher dimensionality. If the matrix is full rank, this operation is inertible. Singular Value Decomposition The singular alue decomposition (SVD) is a standard form for representing a matrix. It is often taught near the end of a one-semester graduate course on linear algebra (or not at all), probably because the proof is fairly inoled. This is a shame, because it is one of the most fundamental and beautiful results (and extremely useful as well). Basic result (stated without proof): any matrix M may be decomposed into a product of three matrices: M = USV T such that U and V are orthogonal and S is diagonal with positie entries. The matrix S always 10

has the same dimensions as M, and the diagonal elements of S are called the singular alues. The adantage of this decomposition is that it describes the action of M in terms of easily understood pieces: a (generalized) rotation, scaling of the axes, and another rotation. Gien this decomposition, we can directly answer many important questions regarding the matrix. M = U S V T V T S U Using the diagram below, conince yourself that the following must hold: the nullspace of M is spanned by those columns of V associated with zero (or nonexistent) singular alues. Een better, these columns proide an orthogonal basis for the nullspace. the column space (also known as the range space or target space) ofm corresponds to columns of U associated with non-zero singular alues. Again, these columns proide an orthogonal basis. the matrix M is inertible if (and only if) the number of nonzero singular alues is equal to the number of columns of M (i.e., the dimensionality of the input space). M U S V T s 1 s 2 = (all zeros) 0 0 } } orthogonal basis for range space orthogonal basis for null space Some fine print... The SVD always exists, but may be non-unique in the following ways: 1. One can permute the columns of U, diagonal elements of S, andcolumnsofv (as long as they re all permuted the same way). 2. One can negate corresponding columns of of U and V. 3. Columns of U/V with equal corresponding singular alues may be orthogonally transformed. The same transformation must be used on columns of both U and V. 11