Ch 7_part1 - Vector is an ordered set of real (or complex)...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Vector is an ordered set of real (or complex) numbers arranged as a row or column x ª x1 º «x » « 2» «» «» ¬ xm ¼ y > y1 y2  yn @ z z z scalar – vector – matrix – lowercase Greek (VDE) lowercase roman (u,v,x,y,b) uppercase roman (A,B,C) 1 Vector Operations z Addition and Subtraction involve corresponding elements of a different vector with the same number of elements z Multiplication by a Scalar involves multiplication of every element by the scalar z Vector Transpose converts row vector to a column vector or vice versa 2 Linear Combination involves scalar multiplication and vector addition Du  Ev ª u1 º ª v1 º «u » «v » 2» D« E « 2» «» «» «» «» um ¼ ¬ ¬vm ¼ w ª w1 º «w » « 2» «» «» ¬ wm ¼ 3 ª D u1  bv1 º « D u  bv » 2» «2 « »  « » D um  bvm ¼ ¬ Vector Inner Product is an operation between two vectors that have the same number of elements z ALWAYS results in a scalar MUST be a row vector times a column vector Can use transpose for two column vectors z z V x˜ y œV ¦x y i1 i n i >x1 x2 x3 ª y1 º «y » x4 @ « 2 » « y3 » «» ¬ y4 ¼ x1 y1  x2 y2  x3 y3  x4 y4 4 Vector Norms compare the size (magnitude) of a vector z For example, it makes sense that z z “Unit” vector has a magnitude of 1 “Zero” vector has a magnitude of 0 z Absolute Value is a measure of magnitude for scalars D!E z Norm is a measure of magnitude for vectors x!y 5 Vector Norms What is the velocity u=3i+4j What is the speed? u 32  4 2 5 6 Vector Norms z Euclidean Norms in 2D and 3D are geometric lengths la z 42  22 20 lb 42  22 20 lc 2 2  12 5 Euclidean Norms in multidimensions x z 2 x 2 1  x  x 2 2 2 n 1 2 Can be expressed in terms of the inner product x 2 xT x 7 Three Vector Norms are common and useful and belong to the family of p-norms x z p x x p 1  x  x p 2 p n 1 p L2 is one of the p-norms L1 (p = 1)norm of a vector is z x1 z 1  x2    xn ¦x i1 n i L’ norm (p = ’ ) or max norm of a vector is x f max x1 , x2 ,  , xn 8 Properties of Vector Norms (1) x !0 xz0 (2) Dx Dx (3) x y d x  y Triangle Inequality 9 Orthogonal Vectors cos T uT v u2v 2 z In 2D we say two vectors are perpendicular/orthogonal if T = 90 Two vectors are orthogonal if and only if the dot product is zero z 10 Orthonormal Vectors are unit vectors that are orthogonal z Unit vector has a magnitude of 1 Any vector can be converted to a unit vector by dividing by its L2 norm z u ^ u u2 11 Matrices are arrays of real or complex numbers z Upper Case Roman Letters (e.g. A, B, C) MATLAB – difference between matrix and a vector is the # of rows and columns Rows and Columns of a matrix are vectors z z z Matrix is viewed as a collection of rows or column vectors 12 Matrix Operations Addition and Subtraction is performed element by element z C z A B œ ci , j ai , j  bi , j i 1,  m; j 1,  n Multiplication by a scalar just multiplies the scalar by every element B VA œ z bi , j V ai , j i 1,  m; j 1,  n Matrix Transpose converts each row into a column and vice versa B AT œ bi , j a j ,i i 1,  m; j 1,  n 13 Multiplication of matrices and vectors is an essential operation in numerical linear algebra z Matrix “A” times column vector “x” can be viewed as: z z Linear combination of column of columns of “A” Series of inner products involving the rows of “A” b ªb1 º «b » « 2» «» «» ¬bn ¼ ª a11 «a « 21 « « ¬ am1 Ax a12 a22  am 2  a1n º ª x 1 º  a 2 n » « x2 » »« »   »«  » »« »  amn ¼ ¬ xn ¼ 14 The Vector-Matrix Product Ax=b produces a vector from a linear combination of the column vectors of A ª a11 «a « 21 « « ¬am1 a12 a22  am 2  a1n º ª x1 º  a 2 n » « x2 » »« »   »«  » »« »  amn ¼ ¬ xn ¼ [m x n] [n x 1] ªb1 º «b » « 2» «» «» ¬bn ¼ = [m x1] ª a11 º ª a12 º ª a1n º «a » «a » «a » 21 22 » x1 «  x2 «    xn « 1n » «» «» «» «» «» «» ¬am1 ¼ ¬ am 2 ¼ ¬amn ¼ ª b1 º «b » « 2» «» «» ¬bm ¼ 15 An alternative view is obtained by considering the matrix as a collection of rows ª a11 «a « 21 « « ¬am1 a12  a1n º ª x1 º a22  a2 n » « x2 » »« »    »«  » »« » am 2  amn ¼ ¬ xn ¼ ªb1 º «b » « 2» «» «» ¬bn ¼ Dot product of each row (transposed) of “A” times the column vector “x” b1 b2  bm a11 x1  a12 x2   a1n xn a21 x1  a22 x2   a2 n xn am1 x1  am 2 x2   amn xn 16 Vector-Matrix Multiplication is different from Matrix-Vector Multiplication z Matrix-Vector multiplication has a column vector on right. The result is a column vector Vector-Matrix multiplication has a row vector on left and the result is a row vector MATLAB uses “*” and takes care of the result for us z z 17 The product of 2 matrices is another matrix z The column view provides mathematical insight The row view is easiest to perform with hand calculations The MATLAB * operator takes care of the details [m x r] [r x n] = [m x n] z z z § a11  a1r · § b11  b1n · ¨ ¸¨ ¸    ¸¨    ¸ ¨ ¨a ¸¨ ¸ © m1  amr ¹ © br1  brn ¹ § c11  c1n · ¨ ¸   ¸ ¨ ¨c ¸ © m1  cmn ¹ 18 Column View is a linear combination A*B = C Worry about ONE column of B at a time and get one column of C at a time i ª « « « « ¬ A r º » » » » ¼ j ªº «» «b(j)» «» «» ¬¼ ªº «» «c(j)» «» «» ¬¼ Perform a linear combination to find column of new matrix and repeat 19 Column View is a linear combination A*B = C Worry about ONE column of B at a time and get one column of C at a time § a11 ¨ ¨ a21 ¨a © 31 a12 a22 a32 a13 · § b11 b12 ¸¨ a23 ¸ ¨ b21 b22 a33 ¸ ¨ b31 b32 ¹© b13 · ¸ b23 ¸ b33 ¸ ¹ § c11 c12 ¨ ¨ c21 c22 ¨c © 31 c32 c13 · ¸ c23 ¸ c33 ¸ ¹ Perform a matrix-vector product of every column of B to determine new column of C Ab( j ) c( j ) Col “j” of B created col “j” of C We have already learned how to do matrix-vector products 20 The Row View is a little easier to understand z Perform the dot product of row “i” in Matrix A and column “j” of Matrix B ª «a « i ,1 « « ¬ ai , 2 ºª «  ai , r » « » »« »« ¼« ¬ b1, j b2 , j  br , j º » » » » » ¼ ª « « « « ¬ ci,j º » » » » ¼ 21 The Row View is a little easier to understand Perform the DOT PRODUCT of row “i” in Matrix A and column “j” of Matrix B § a11 ¨ ¨ a21 ¨a © 31 a12 a22 a32 a13 · § b11 b12 ¸¨ a23 ¸ ¨ b21 b22 ¨ a33 ¸ © b31 b32 ¹ b13 · ¸ b23 ¸ ¸ b33 ¹ § c11 c12 ¨ ¨ c21 c22 ¨ © c31 c32 c13 · ¸ c23 ¸ c33 ¸ ¹ c22 z a21b12  a22b22  a23b32 Any product involving matrices and vectors requires that the operands have equal inner dimensions Order Matters! z AB z BA 22 ...
View Full Document

Ask a homework question - tutors are online