Linear Algebra Using MATLAB

Total Page:16

File Type:pdf, Size:1020Kb

Linear Algebra Using MATLAB Linear Algebra Using MATLAB MATH 5331 1 May 12, 2010 1Selected material from the text Linear Algebra and Differential Equations Using MATLAB by Martin Golubitsky and Michael Dellnitz Contents 1 Preliminaries 1 1.1 Vectors and Matrices . 1 1.2 MATLAB . 4 1.3 Special Kinds of Matrices . 8 1.4 The Geometry of Vector Operations . 11 2 Solving Linear Equations 18 2.1 Systems of Linear Equations and Matrices . 19 2.2 The Geometry of Low-Dimensional Solutions . 28 2.3 Gaussian Elimination . 36 2.4 Reduction to Echelon Form . 50 2.5 Linear Equations with Special Coefficients . 57 2.6 *Uniqueness of Reduced Echelon Form . 64 3 Matrices and Linearity 66 3.1 Matrix Multiplication of Vectors . 67 3.2 Matrix Mappings . 72 3.3 Linearity . 78 3.4 The Principle of Superposition . 84 i 3.5 Composition and Multiplication of Matrices . 88 3.6 Properties of Matrix Multiplication . 92 3.7 Solving Linear Systems and Inverses . 97 3.8 Determinants of 2 2 Matrices . 106 × 4 Determinants and Eigenvalues 110 4.1 Determinants . 110 4.2 Determinants, An Alternative Treatment . 124 4.3 Eigenvalues . 136 4.4 Eigenvalues and Eigenvectors . 143 4.5 *Markov Chains . 156 4.6 Appendix: Existence of Determinants . 166 5 Vector Spaces 169 5.1 Vector Spaces and Subspaces . 170 5.2 Construction of Subspaces . 177 5.3 Spanning Sets and MATLAB . 181 5.4 Linear Dependence and Linear Independence . 185 5.5 Dimension and Bases . 188 5.6 The Proof of the Main Theorem . 193 6 Linear Maps and Changes of Coordinates 200 6.1 Linear Mappings and Bases . 200 6.2 Row Rank Equals Column Rank . 207 6.3 Vectors and Matrices in Coordinates . 211 6.4 Matrices of Linear Maps on a Vector Space . 219 ii 7 Orthogonality 224 7.1 Orthonormal Bases . 224 7.2 Least Squares Approximations . 228 7.3 Least Squares Fitting of Data . 234 7.4 Symmetric Matrices . 242 7.5 Orthogonal Matrices and QR Decompositions . 246 8 Matrix Normal Forms 254 8.1 Real Diagonalizable Matrices . 254 8.2 Simple Complex Eigenvalues . 260 8.3 Multiplicity and Generalized Eigenvectors . 270 8.4 The Jordan Normal Form Theorem . 276 8.5 *Appendix: Markov Matrix Theory . 285 8.6 *Appendix: Proof of Jordan Normal Form . 288 MATLAB Commands 292 iii Chapter 1 Preliminaries The subjects of linear algebra and differential equations involve manipulating vector equa- tions. In this chapter we introduce our notation for vectors and matrices — and we intro- duce MATLAB, a computer program that is designed to perform vector manipulations in a natural way. We begin, in Section 1.1, by defining vectors and matrices, and by explaining how to add and scalar multiply vectors and matrices. In Section 1.2 we explain how to enter vectors and matrices into MATLAB, and how to perform the operations of addition and scalar multipli- cation in MATLAB. There are many special types of matrices; these types are introduced in Section 1.3. In the concluding section, we introduce the geometric interpretations of vector addition and scalar multiplication; in addition we discuss the angle between vectors through the use of the dot product of two vectors. 1.1 Vectors and Matrices In their elementary form, matrices and vectors are just lists of real numbers in different formats. An n-vector is a list of n numbers (x1,x2,...,xn). We may write this vector as a row vector as we have just done — or as a column vector x1 . . . xn The set of all (real-valued) n-vectors is denoted by Rn; so points in Rn are called vectors. The sets Rn when n is small are very familiar sets. The set R1 = R is the real number line, and the set R2 is the Cartesian plane. The set R3 consists of points or vectors in three dimensional space. 1 An m n matrix is a rectangular array of numbers with m rows and n columns. A × general 2 3 matrix has the form × a a a A = 11 12 13 . ' a21 a22 a23 ( We use the convention that matrix entries aij are indexed so that the first subscript i refers to the row while the second subscript j refers to the column. So the entry a21 refers to the matrix entry in the 2nd row, 1st column. An m n matrix A and an m! n! matrix B are equal precisely when the sizes of the × × matrices are equal (m = m! and n = n!) and when each of the corresponding entries are equal (aij = bij). There is some redundancy in the use of the terms “vector” and “matrix”. For example, a row n-vector may be thought of as a 1 n matrix, and a column n-vector may be thought × of as a n 1 matrix. There are situations where matrix notation is preferable to vector × notation and vice-versa. Addition and Scalar Multiplication of Vectors There are two basic operations on vectors: addition and scalar multiplication. Let x = (x1,...,xn) and y =(y1,...,yn)ben-vectors. Then x + y =(x1 + y1,...,xn + yn); that is, vector addition is defined as componentwise addition. Similarly, scalar multiplication is defined as componentwise multiplication. A scalar is just a number. Initially, we use the term scalar to refer to a real number — but later on we sometimes use the term scalar to refer to a complex number. Suppose r is a real number; then the multiplication of a vector by the scalar r is defined as rx =(rx1,...,rxn). Subtraction of vectors is defined simply as x y =(x y ,...,x y ). − 1 − 1 n − n Formally, subtraction of vectors may also be defined as x y = x +( 1)y. − − Division of a vector x by a scalar r is defined to be 1 x. r The standard difficulties concerning division by zero still hold. 2 Addition and Scalar Multiplication of Matrices Similarly, we add two m n matrices by adding corresponding entries, and we multiply a × scalar times a matrix by multiplying each entry of the matrix by that scalar. For example, 02 1 3 1 1 + − = − ' 46( ' 14( ' 5 10 ( and 2 4 8 16 4 − = − . ' 31( ' 12 4 ( The main restriction on adding two matrices is that the matrices must be of the same size. So you cannot add a 4 3 matrix to 6 2 matrix — even though they both have twelve × × entries. Hand Exercises In Exercises 1 – 3, let x = (2, 1, 3) and y = (1, 1, 1) and compute the given expression. − 1. x + y. 2. 2x 3y. − 3. 4x. 4. Let A be the 3 4 matrix × 2 101 − A = 347 10 . − 6 342 − n (a) For which n is a row of A a vector in R ? (b) What is the 2nd column of A? (c) Let a be the entry of A in the ith row and the jth column. What is a a ? ij 23 − 31 For each of the pairs of vectors or matrices in Exercises 5 – 9, decide whether addition of the members of the pair is possible; and, if addition is possible, perform the addition. 5. x = (2, 1) and y = (3, 1). − 6. x = (1, 2, 2) and y =( 2, 1, 4). − 7. x = (1, 2, 3) and y =( 2, 1). − 13 21 8. A = and B = . 04 1 2 ' ( ' − ( 3 210 21 9. A = 410 and B = . 1 2 000 ' − ( 21 02 In Exercises 10 – 11, let A = and B = and compute the given expression. 14 3 1 ' − ( ' − ( 10. 4A + B. 11. 2A 3B. − 1.2 MATLAB We shall use MATLAB to compute addition and scalar multiplication of vectors in two and three dimensions. This will serve the purpose of introducing some basic MATLAB commands. Entering Vectors and Vector Operations Begin a MATLAB session. We now discuss how to enter a vector into MATLAB. The syntax is straightforward; to enter the row vector x = (1, 2, 1) type1 x = [1 2 1] and MATLAB responds with x= 121 Next we show how easy it is to perform addition and scalar multiplication in MATLAB. Enter the row vector y = (2, 1, 1) by typing − y = [2 -1 1] and MATLAB responds with y= 2 -1 1 1MATLAB has several useful line editing features. We point out two here: (a) Horizontal arrow keys ( , ) move the cursor one space without deleting a character. → ← (b) Vertical arrow keys ( , ) recall previous and next command lines. ↑ ↓ 4 To add the vectors x and y, type x+y and MATLAB responds with ans = 312 This vector is easily checked to be the sum of the vectors x and y. Similarly, to perform a scalar multiplication, type 2*x which yields ans = 242 MATLAB subtracts the vector y from the vector x in the natural way. Type x-y to obtain ans = -1 3 0 We mention two points concerning the operations that we have just performed in MATLAB. (a) When entering a vector or a number, MATLAB automatically echoes what has been entered. This echoing can be suppressed by appending a semicolon to the line. For example, type z = [-1 2 3]; and MATLAB responds with a new line awaiting a new command. To see the contents of the vector z just type z and MATLAB responds with z= -1 2 3 (b) MATLAB stores in a new vector the information obtained by algebraic manipulation. Type a = 2*x - 3*y + 4*z; 5 Now type a to find a= -8 15 11 We see that MATLAB has created a new row vector a with the correct number of entries. Note: In order to use the result of a calculation later in a MATLAB session, we need to name the result of that calculation.
Recommended publications
  • Introduction to Linear Bialgebra
    View metadata, citation and similar papers at core.ac.uk brought to you by CORE provided by University of New Mexico University of New Mexico UNM Digital Repository Mathematics and Statistics Faculty and Staff Publications Academic Department Resources 2005 INTRODUCTION TO LINEAR BIALGEBRA Florentin Smarandache University of New Mexico, [email protected] W.B. Vasantha Kandasamy K. Ilanthenral Follow this and additional works at: https://digitalrepository.unm.edu/math_fsp Part of the Algebra Commons, Analysis Commons, Discrete Mathematics and Combinatorics Commons, and the Other Mathematics Commons Recommended Citation Smarandache, Florentin; W.B. Vasantha Kandasamy; and K. Ilanthenral. "INTRODUCTION TO LINEAR BIALGEBRA." (2005). https://digitalrepository.unm.edu/math_fsp/232 This Book is brought to you for free and open access by the Academic Department Resources at UNM Digital Repository. It has been accepted for inclusion in Mathematics and Statistics Faculty and Staff Publications by an authorized administrator of UNM Digital Repository. For more information, please contact [email protected], [email protected], [email protected]. INTRODUCTION TO LINEAR BIALGEBRA W. B. Vasantha Kandasamy Department of Mathematics Indian Institute of Technology, Madras Chennai – 600036, India e-mail: [email protected] web: http://mat.iitm.ac.in/~wbv Florentin Smarandache Department of Mathematics University of New Mexico Gallup, NM 87301, USA e-mail: [email protected] K. Ilanthenral Editor, Maths Tiger, Quarterly Journal Flat No.11, Mayura Park, 16, Kazhikundram Main Road, Tharamani, Chennai – 600 113, India e-mail: [email protected] HEXIS Phoenix, Arizona 2005 1 This book can be ordered in a paper bound reprint from: Books on Demand ProQuest Information & Learning (University of Microfilm International) 300 N.
    [Show full text]
  • 21. Orthonormal Bases
    21. Orthonormal Bases The canonical/standard basis 011 001 001 B C B C B C B0C B1C B0C e1 = B.C ; e2 = B.C ; : : : ; en = B.C B.C B.C B.C @.A @.A @.A 0 0 1 has many useful properties. • Each of the standard basis vectors has unit length: q p T jjeijj = ei ei = ei ei = 1: • The standard basis vectors are orthogonal (in other words, at right angles or perpendicular). T ei ej = ei ej = 0 when i 6= j This is summarized by ( 1 i = j eT e = δ = ; i j ij 0 i 6= j where δij is the Kronecker delta. Notice that the Kronecker delta gives the entries of the identity matrix. Given column vectors v and w, we have seen that the dot product v w is the same as the matrix multiplication vT w. This is the inner product on n T R . We can also form the outer product vw , which gives a square matrix. 1 The outer product on the standard basis vectors is interesting. Set T Π1 = e1e1 011 B C B0C = B.C 1 0 ::: 0 B.C @.A 0 01 0 ::: 01 B C B0 0 ::: 0C = B. .C B. .C @. .A 0 0 ::: 0 . T Πn = enen 001 B C B0C = B.C 0 0 ::: 1 B.C @.A 1 00 0 ::: 01 B C B0 0 ::: 0C = B. .C B. .C @. .A 0 0 ::: 1 In short, Πi is the diagonal square matrix with a 1 in the ith diagonal position and zeros everywhere else.
    [Show full text]
  • Linear Algebra for Dummies
    Linear Algebra for Dummies Jorge A. Menendez October 6, 2017 Contents 1 Matrices and Vectors1 2 Matrix Multiplication2 3 Matrix Inverse, Pseudo-inverse4 4 Outer products 5 5 Inner Products 5 6 Example: Linear Regression7 7 Eigenstuff 8 8 Example: Covariance Matrices 11 9 Example: PCA 12 10 Useful resources 12 1 Matrices and Vectors An m × n matrix is simply an array of numbers: 2 3 a11 a12 : : : a1n 6 a21 a22 : : : a2n 7 A = 6 7 6 . 7 4 . 5 am1 am2 : : : amn where we define the indexing Aij = aij to designate the component in the ith row and jth column of A. The transpose of a matrix is obtained by flipping the rows with the columns: 2 3 a11 a21 : : : an1 6 a12 a22 : : : an2 7 AT = 6 7 6 . 7 4 . 5 a1m a2m : : : anm T which evidently is now an n × m matrix, with components Aij = Aji = aji. In other words, the transpose is obtained by simply flipping the row and column indeces. One particularly important matrix is called the identity matrix, which is composed of 1’s on the diagonal and 0’s everywhere else: 21 0 ::: 03 60 1 ::: 07 6 7 6. .. .7 4. .5 0 0 ::: 1 1 It is called the identity matrix because the product of any matrix with the identity matrix is identical to itself: AI = A In other words, I is the equivalent of the number 1 for matrices. For our purposes, a vector can simply be thought of as a matrix with one column1: 2 3 a1 6a2 7 a = 6 7 6 .
    [Show full text]
  • Systems Analysis of Stochastic and Population Balance Models for Chemically Reacting Systems
    Systems Analysis of Stochastic and Population Balance Models for Chemically Reacting Systems by Eric Lynn Haseltine A dissertation submitted in partial fulfillment of the requirements for the degree of DOCTOR OF PHILOSOPHY (Chemical Engineering) at the UNIVERSITY OF WISCONSIN–MADISON 2005 c Copyright by Eric Lynn Haseltine 2005 All Rights Reserved i To Lori and Grace, for their love and support ii Systems Analysis of Stochastic and Population Balance Models for Chemically Reacting Systems Eric Lynn Haseltine Under the supervision of Professor James B. Rawlings At the University of Wisconsin–Madison Chemical reaction models present one method of analyzing complex reaction pathways. Most models of chemical reaction networks employ a traditional, deterministic setting. The short- comings of this traditional framework, namely difficulty in accounting for population het- erogeneity and discrete numbers of reactants, motivate the need for more flexible modeling frameworks such as stochastic and cell population balance models. How to efficiently use models to perform systems-level tasks such as parameter estimation and feedback controller design is important in all frameworks. Consequently, this thesis focuses on three main areas: 1. improving the methods used to simulate and perform systems-level tasks using stochas- tic models, 2. formulating and applying cell population balance models to better account for experi- mental data, and 3. applying moving-horizon estimation to improve state estimates for nonlinear reaction systems. For stochastic models, we have derived and implemented techniques that improve simulation efficiency and perform systems-level tasks using these simulations. For discrete stochastic models, these systems-level tasks rely on approximate, biased sensitivities, whereas continuous models (i.e.
    [Show full text]
  • Math 2331 – Linear Algebra 6.2 Orthogonal Sets
    6.2 Orthogonal Sets Math 2331 { Linear Algebra 6.2 Orthogonal Sets Jiwen He Department of Mathematics, University of Houston [email protected] math.uh.edu/∼jiwenhe/math2331 Jiwen He, University of Houston Math 2331, Linear Algebra 1 / 12 6.2 Orthogonal Sets Orthogonal Sets Basis Projection Orthonormal Matrix 6.2 Orthogonal Sets Orthogonal Sets: Examples Orthogonal Sets: Theorem Orthogonal Basis: Examples Orthogonal Basis: Theorem Orthogonal Projections Orthonormal Sets Orthonormal Matrix: Examples Orthonormal Matrix: Theorems Jiwen He, University of Houston Math 2331, Linear Algebra 2 / 12 6.2 Orthogonal Sets Orthogonal Sets Basis Projection Orthonormal Matrix Orthogonal Sets Orthogonal Sets n A set of vectors fu1; u2;:::; upg in R is called an orthogonal set if ui · uj = 0 whenever i 6= j. Example 82 3 2 3 2 39 < 1 1 0 = Is 4 −1 5 ; 4 1 5 ; 4 0 5 an orthogonal set? : 0 0 1 ; Solution: Label the vectors u1; u2; and u3 respectively. Then u1 · u2 = u1 · u3 = u2 · u3 = Therefore, fu1; u2; u3g is an orthogonal set. Jiwen He, University of Houston Math 2331, Linear Algebra 3 / 12 6.2 Orthogonal Sets Orthogonal Sets Basis Projection Orthonormal Matrix Orthogonal Sets: Theorem Theorem (4) Suppose S = fu1; u2;:::; upg is an orthogonal set of nonzero n vectors in R and W =spanfu1; u2;:::; upg. Then S is a linearly independent set and is therefore a basis for W . Partial Proof: Suppose c1u1 + c2u2 + ··· + cpup = 0 (c1u1 + c2u2 + ··· + cpup) · = 0· (c1u1) · u1 + (c2u2) · u1 + ··· + (cpup) · u1 = 0 c1 (u1 · u1) + c2 (u2 · u1) + ··· + cp (up · u1) = 0 c1 (u1 · u1) = 0 Since u1 6= 0, u1 · u1 > 0 which means c1 = : In a similar manner, c2,:::,cp can be shown to by all 0.
    [Show full text]
  • Math 22 – Linear Algebra and Its Applications
    Math 22 – Linear Algebra and its applications - Lecture 25 - Instructor: Bjoern Muetzel GENERAL INFORMATION ▪ Office hours: Tu 1-3 pm, Th, Sun 2-4 pm in KH 229 Tutorial: Tu, Th, Sun 7-9 pm in KH 105 ▪ Homework 8: due Wednesday at 4 pm outside KH 008. There is only Section B,C and D. 5 Eigenvalues and Eigenvectors 5.1 EIGENVECTORS AND EIGENVALUES Summary: Given a linear transformation 푇: ℝ푛 → ℝ푛, then there is always a good basis on which the transformation has a very simple form. To find this basis we have to find the eigenvalues of T. GEOMETRIC INTERPRETATION 5 −3 1 1 Example: Let 퐴 = and let 푢 = 푥 = and 푣 = . −6 2 0 2 −1 1.) Find A푣 and Au. Draw a picture of 푣 and A푣 and 푢 and A푢. 2.) Find A(3푢 +2푣) and 퐴2 (3푢 +2푣). Hint: Use part 1.) EIGENVECTORS AND EIGENVALUES ▪ Definition: An eigenvector of an 푛 × 푛 matrix A is a nonzero vector x such that 퐴푥 = 휆푥 for some scalar λ in ℝ. In this case λ is called an eigenvalue and the solution x≠ ퟎ is called an eigenvector corresponding to λ. ▪ Definition: Let A be an 푛 × 푛 matrix. The set of solutions 푛 Eig(A, λ) = {x in ℝ , such that (퐴 − 휆퐼푛)x = 0} is called the eigenspace Eig(A, λ) of A corresponding to λ. It is the null space of the matrix 퐴 − 휆퐼푛: Eig(A, λ) = Nul(퐴 − 휆퐼푛) Slide 5.1- 7 EIGENVECTORS AND EIGENVALUES 16 Example: Show that 휆 =7 is an eigenvalue of matrix A = 52 and find the corresponding eigenspace Eig(A,7).
    [Show full text]
  • Different Forms of Linear Systems, Linear Combinations, and Span
    Math 20F, 2015SS1 / TA: Jor-el Briones / Sec: A01 / Handout 2 Page 1 of2 Different forms of Linear Systems, Linear Combinations, and Span (1.3-1.4) Terms you should know Linear combination (and weights): A vector y is called a linear combination of vectors v1; v2; :::; vk if given some numbers c1; c2; :::; ck, y = c1v1 + c2v2 + ::: + ckvk The numbers c1; c2; :::; ck are called weights. Span: We call the set of ALL the possible linear combinations of a set of vectors to be the span of those vectors. For example, the span of v1 and v2 is written as span(v1; v2) NOTE: The zero vector is in the span of ANY set of vectors in Rn. Rn: The set of all vectors with n entries 3 ways to write a linear system with m equations and n unknowns If A is the m×n coefficient matrix corresponding to a linear system, with columns a1; a2; :::; an, and b in Rm is the constant vector corresponding to that linear system, we may represent the linear system using 1. A matrix equation: Ax = b 2. A vector equation: x1a1 + x2a2 + ::: + xnan = b, where x1; x2; :::xn are numbers. h i 3. An augmented matrix: A j b NOTE: You should know how to multiply a matrix by a column vector, and that doing so would result in some linear combination of the columns of that matrix. Math 20F, 2015SS1 / TA: Jor-el Briones / Sec: A01 / Handout 2 Page 2 of2 Important theorems to know: Theorem. (Chapter 1, Theorem 3) If A is an m × n matrix, with columns a1; a2; :::; an and b is in Rm, the matrix equation Ax = b has the same solution set as the vector equation x1a1 + x2a2 + ::: + xnan = b as well as the system of linear equations whose augmented matrix is h i A j b Theorem.
    [Show full text]
  • Inner Product Spaces
    CHAPTER 6 Woman teaching geometry, from a fourteenth-century edition of Euclid’s geometry book. Inner Product Spaces In making the definition of a vector space, we generalized the linear structure (addition and scalar multiplication) of R2 and R3. We ignored other important features, such as the notions of length and angle. These ideas are embedded in the concept we now investigate, inner products. Our standing assumptions are as follows: 6.1 Notation F, V F denotes R or C. V denotes a vector space over F. LEARNING OBJECTIVES FOR THIS CHAPTER Cauchy–Schwarz Inequality Gram–Schmidt Procedure linear functionals on inner product spaces calculating minimum distance to a subspace Linear Algebra Done Right, third edition, by Sheldon Axler 164 CHAPTER 6 Inner Product Spaces 6.A Inner Products and Norms Inner Products To motivate the concept of inner prod- 2 3 x1 , x 2 uct, think of vectors in R and R as x arrows with initial point at the origin. x R2 R3 H L The length of a vector in or is called the norm of x, denoted x . 2 k k Thus for x .x1; x2/ R , we have The length of this vector x is p D2 2 2 x x1 x2 . p 2 2 x1 x2 . k k D C 3 C Similarly, if x .x1; x2; x3/ R , p 2D 2 2 2 then x x1 x2 x3 . k k D C C Even though we cannot draw pictures in higher dimensions, the gener- n n alization to R is obvious: we define the norm of x .x1; : : : ; xn/ R D 2 by p 2 2 x x1 xn : k k D C C The norm is not linear on Rn.
    [Show full text]
  • Math 480 Notes on Orthogonality the Word Orthogonal Is a Synonym for Perpendicular. Question 1: When Are Two Vectors V 1 and V2
    Math 480 Notes on Orthogonality The word orthogonal is a synonym for perpendicular. n Question 1: When are two vectors ~v1 and ~v2 in R orthogonal to one another? The most basic answer is \if the angle between them is 90◦" but this is not very practical. How could you tell whether the vectors 0 1 1 0 1 1 @ 1 A and @ 3 A 1 1 are at 90◦ from one another? One way to think about this is as follows: ~v1 and ~v2 are orthogonal if and only if the triangle formed by ~v1, ~v2, and ~v1 − ~v2 (drawn with its tail at ~v2 and its head at ~v1) is a right triangle. The Pythagorean Theorem then tells us that this triangle is a right triangle if and only if 2 2 2 (1) jj~v1jj + jj~v2jj = jj~v1 − ~v2jj ; where jj − jj denotes the length of a vector. 0 x1 1 . The length of a vector ~x = @ . A is easy to measure: the Pythagorean Theorem (once again) xn tells us that q 2 2 jj~xjj = x1 + ··· + xn: This expression under the square root is simply the matrix product 0 x1 1 T . ~x ~x = (x1 ··· xn) @ . A : xn Definition. The inner product (also called the dot product) of two vectors ~x;~y 2 Rn, written h~x;~yi or ~x · ~y, is defined by n T X hx; yi = ~x ~y = xiyi: i=1 Since matrix multiplication is linear, inner products satisfy h~x;~y1 + ~y2i = h~x;~y1i + h~x;~y2i h~x1; a~yi = ah~x1; ~yi: (Similar formulas hold in the first coordinate, since h~x;~yi = h~y; ~xi.) Now we can write 2 2 jj~v1 − ~v2jj = h~v1 − ~v2;~v1 − ~v2i = h~v1;~v1i − 2h~v1;~v2i + h~v2;~v2i = jj~v1jj − 2h~v1;~v2i + jj~v2jj; so Equation (1) holds if and only if h~v1;~v2i = 0: n Answer to Question 1: Vectors ~v1 and ~v2 in R are orthogonal if and only if h~v1;~v2i = 0.
    [Show full text]
  • Notes Lecture 3A Matrices and Vectors (Addition, Scalar Multiplication
    Arithmetic with vectors and matrices linear combination Transpose of a matrix Lecture 3a Matrices and Vectors Upcoming (due Thurs): Reading HW 3a Plan Introduce vectors, matrices, and matrix arithmetic. 1/14 Arithmetic with vectors and matrices linear combination Transpose of a matrix Definition: Vectors A vector is a column of numbers, surrounded by brackets. Examples of vectors 0 3 2 − 0 0 ties 3 2 3 3 2 O 3 2 3 0 − 1 4 are 3,0 I and 2 607 ⇥ ⇤ 6 2 7 4 5 6 7 6 7 4 5 4 5 The entries are sometimes called coordinates. • The size of a vector is the number of entries. • An n-vector is a vector of size n. • We sometimes call these column vectors, to distinguish them • from row vectors (when we write the numbers horizontally). An a row vector 2 3 4 example of 2/14 Arithmetic with vectors and matrices linear combination Transpose of a matrix The purpose of vectors The purpose of vectors is to collect related numbers together and work with them as a single object. Example of a vector: Latitude and longitude A point on the globe can be described by two numbers: the latitude and longitude. These can be combined into a single vector: Position of Norman’s train station = 35.13124 , 97.26343 ◦ − ◦ ⇥ row vector ⇤ 3/14 Arithmetic with vectors and matrices linear combination Transpose of a matrix Example of a vector: solution of a linear system A solution of a linear system is given in terms of values of variables, even though we think of this as one object: x =3, y =0, z = 1 − (x, y, z)=(3, 0, 1) − We can restate this as a (column) vector: x 3 y = 0 2 3 2 3 z 1 − 4 5 4 5 4/14 Arithmetic with vectors and matrices linear combination Transpose of a matrix Definition: Matrices A matrix is a rectangular grid of numbers, surrounded by brackets.
    [Show full text]
  • Linear Combinations & Matrices
    Linear Algebra II: linear combinations & matrices Math Tools for Neuroscience (NEU 314) Fall 2016 Jonathan Pillow Princeton Neuroscience Institute & Psychology. Lecture 3 (Thursday 9/22) accompanying notes/slides Linear algebra “Linear algebra has become as basic and as applicable as calculus, and fortunately it is easier.” - Glibert Strang, Linear algebra and its applications today’s topics • linear projection (review) • orthogonality (review) • linear combination • linear independence / dependence • matrix operations: transpose, multiplication, inverse Did not get to: • vector space • subspace • basis • orthonormal basis Linear Projection Exercise w = [2,2] v1 = [2,1] v2 = [5,0] Compute: Linear projection of w onto lines defined by v1 and v2 linear combination is clearly a vector space [verify]. • scaling and summing applied to a group of vectors Working backwards, a set of vectors is said to span a vector space if one can write any v vector in the vector space as a linear com- 1 v3 bination of the set. A spanning set can be redundant: For example, if two of the vec- tors are identical, or are scaled copies of each other. This redundancy is formalized by defining linear• a independence group of vectors.Asetofvec- is linearly tors {⃗v1,⃗v2,...⃗vdependentM } is linearly independent if one can if be written as v2 (and only if) thea only linear solution combination to the equation of the others • otherwise,αn⃗vn =0 linearly independent !n is αn =0(for all n). A basis for a vector space is a linearly in- dependent spanning set. For example, con- sider the plane of this page. One vector is not enough to span the plane.
    [Show full text]
  • Opengl Transformations
    Transformations CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 1 Objectives • Introduce standard transformations - Rotation - Translation - Scaling - Shear • Derive homogeneous coordinate transformation matrices • Learn to build arbitrary transformation matrices from simple transformations E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 2 General Transformations A transformation maps points to other points and/or vectors to other vectors v=T(u) Q=T(P) E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 3 Affine Transformations • Line preserving • Characteristic of many physically important transformations - Rigid body transformations: rotation, translation - Scaling, shear • Importance in graphics is that we need only transform endpoints of line segments and let implementation draw line segment between the transformed endpoints E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 4 Pipeline Implementation T (from application program) frame u T(u) buffer transformation rasterizer v T(v) T(v) v T(v) T(u) u T(u) vertices vertices pixels E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 5 Notation We will be working with both coordinate-free representations of transformations and representations within a particular frame P,Q, R: points in an affine space u, v, w: vectors in an affine space α, β, γ: scalars p, q, r: representations of points -array of 4 scalars in homogeneous coordinates u, v, w: representations of vectors -array of 4 scalars in homogeneous coordinates E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 6 Translation • Move (translate, displace) a point to a new location P’ d P • Displacement determined by a vector d - Three degrees of freedom - P’= P+d E.
    [Show full text]