Week 1 – Vectors And Matrices

3y ago
15 Views
2 Downloads
234.97 KB
14 Pages
Last View : 1m ago
Last Download : 2m ago
Upload by : Lee Brooke
Transcription

Week 1 – Vectors and MatricesRichard Earl Mathematical Institute, Oxford, OX1 2LB,October 2003AbstractAlgebra and geometry of vectors. The algebra of matrices. 2x2 matrices. Inverses. Determinants.Simultaneous linear equations. Standard transformations of the plane.Notation 1 The symbol R2 denotes the set of ordered pairs (x, y) – that is the xy-plane. Similarly R3denotes the set of ordered triples (x, y, z) – that is, three-dimensional space described by three co-ordinatesx, y and z – and Rn denotes a similar n-dimensional space.1VectorsA vector can be thought of in two different ways. Let’s for the moment concentrate on vectors in thexy-plane. From one point of view a vector is just an ordered pair of numbers (x, y). We can associate thisvector with the point in R2 which has co-ordinates x and y. We call this vector the position vectorof the point. From the second point of view a vector is a ‘movement’ or translation. For example, to get fromthe point (3, 4) to the point (4, 5) we need to move ‘one to the right and one up’; this is the samemovement as is required to move from ( 2, 3) to ( 1, 2) or from (1, 2) to (2, 1) . Thinkingabout vectors from this second point of view, all three of these movements are the same vector,because the same translation ‘one right, one up’ achieves each of them, even though the ‘start’ and‘finish’ are different in each case. We would write this vector as (1, 1) . Vectors from this secondpoint of view are sometimes called translation vectors.H1,1L1H4,5LH3,4L40.820.60.4-2-1H 1, 2L0.20.20.40.60.8(1, 1) as a position vectorH 2, 3L11-2H1, 2L2H2, 1L34(1, 1) as a translation These handouts are produced by Richard Earl, who is the Schools Liaison and Access Officer for mathematics, statisticsand computer science at Oxford University. Any comments, suggestions or requests for other material are welcome atearl@maths.ox.ac.uk1

Likewise in three (or higher) dimensions the triple (x, y, z) can be thought of as the point in R3 , whichis x units along the x-axis, y units along the y-axis and z units along the z-axis, or it can represent thetranslation which would take the origin to that point.Notation 2 For ease of notation vectors are often denoted by a single letter, but to show that this is avector quantity, rather than just a single number, the letter is either underlined such as v or written inbold as v.1.1Algebra of VectorsAgain we return to xy-plane. Given two vectors v (v1 , v2 ) and w (w1 , w2 ) we can add them, muchas you would expect, by adding their co-ordinates. That is:v w (v1 , v2 ) (w1 , w2 ) (v1 w1 , v2 w2 ) .This is easiest to see from a diagram:1u H1,1L0.5v0.5-0.5-1v H1, 2L11.52u v-1.5u-2A geometric interpretation of the vector sumThe sum is also easiest to interpret when we consider the vectors as translations. The translation(v1 w1 , v2 w2 ) is the composition of doing the translation (v1 , w1 ) first and then doing the translation (v2 , w2 ) or it can be achieved by doing the translations in the other order – that is, vectoraddition is commutative: v w w v. Note that it makes sense to add two vectors in R2 , or twovectors from R3 etc., but that we can make no obvious sense of adding a vector in R2 to one from R3 –they both need to be of the same type.Given a vector v (v1 , v2 ) and a real number (a scalar) k then the scalar multiple kv is defined askv (kv1 , kv2 ) .When k is a positive integer then we can think of kv as the translation achieved when we translate by vk times. Note that the points kv, as k varies, make up the line which passes through the origin and thepoint v.We write v for ( 1) v ( a, b) and this is the inverse operation of translating by v. And thedifference of two vectors v (v1 , v2 ) and w (w1 , w2 ) is defined asv w v ( w) (v1 w1 , v2 w2 ) .Put another way v w is the vector that translates the point with position vector w to the point withposition vector v.Note that there is also a special vector 0 (0, 0) which may be viewed either as a special point theorigin, where the axes cross, or as the null translation, the translation that doesn’t move anything.2

The vectors (1, 0) and (0, 1) form the standard or canonical basis for R2 . They are denoted by thesymbols i and j respectively. Note that any vector v (x, y) can be written uniquely as a linearcombination of i and j: that is(x, y) xi yjand this is the only way to write (x, y) as a sum of scalar multiples of i and j. Likewise the vectors(1, 0, 0) , (0, 1, 0) , (0, 0, 1) form the canonical basis for R3 and are respectively denoted as i, j and k.Proposition 3 Vector addition and scalar multiplication satisfy the following properties. These properties verify that R2 is a real vector space (cf. Michaelmas Linear Algebra). Let u, v, w R2 and λ, µ R.Thenu 0 uu v v u0u 0u ( u) 0(u v) w u (v w) 1u u(λ µ)u λu µu λ(u v) λu λvλ(µu) (λµ) uEverything above generalises in an obvious way to the case of Rn and from now on we will discussthis general case.1.2Geometry of VectorsAs vectors represent geometric ideas like points and translations, they have important geometric properties as well as algebraic ones. The length of a vector v (v1 , v2 , . . . , vn ), which is written v , is definedto bevu nuX v t(vi )2 .i 1This is exactly what you’d expect it to be: from Pythagoras’ Theorem we see this is the distance of thepoint v from the origin, or equivalently how far a point, translated by v, is from where it started. So ifp and q are two points in the plane, then the vector that will translate p to q is q p, and the distancebetween them is q p (or equally p q ).Note that v 0 and that v 0 if and only if v 0. Also λv λ v for any λ R.Proposition 4 (Triangle Inequality) Let u (u1 , u2 , . . . , un ) , v (v1 , v2 , . . . , vn ) Rn . Then u v u v with equality when u and v are multiples of one another.1u H1,1Lv H1, 2L0.50.511.5-0.5u v-1Geometric interpretation of the triangle inequallity32

Proof. Note that for t R20 u tv nnXX22(ui tvi )2 u 2tui vi t2 v .i 1i 1The RHS of the above inequality is a quadratic in t which is always non-negative and so has non-positivediscriminant (i.e. b2 4ac). Hence!2à nX22ui vi 4 u v 4i 1and so n X ui vi u v . (1)i 1Hence u v 2 u 2 2nXi 1ui vi v 2 u 2 2 u v v 2 ( u v )2to give the required result. The inequality 1 is known as the Cauchy-Schwarz Inequality. Note that we2have equality in b2 4ac if and only if the quadratic u tv 0 has a unique real solution, say t t0 .So u t0 v 0 and we see that u and v are multiples of one another. Hence equality only occurs in thetriangle inequality when u and v are multiples of one another.1.3The Scalar ProductGiven two vectors u (u1 , u2 , . . . , un ) , v (v1 , v2 , . . . , vn ) Rn , the scalar product u · v, also known asthe dot product or Euclidean inner product, is given byu · v u1 v1 u2 v2 · · · un vn .The following properties of the scalar product are easy to verify and are left as exercises. (Note (v)has already been proven in the previous section).Proposition 5 Let u, v, w Rn and λ R. Then(i) u · v v · u;(ii) (λu) · v λ(u · v);(iii) (u v) · w u · w v · w;(iv) u · u u 2 0 and u · u 0 if and only if u 0;(v) (Cauchy-Schwarz Inequality) u · v u v with equality when u and v are multiples of oneanother.We see that the length of a vector u can be written in terms of the scalar product, namely u u · uWe can also define angle using the scalar product in terms of their scalar product.Definition 6 Given two non-zero vectors u, v Rn the angle between them is given by the expressionµ¶u·v 1cos. u v Note that the formula makes sense as 1 u · v/ ( u v ) 1from the Cauchy-Schwarz Inequality. If we take the principles values of cos 1 to be in the range 0 θ πthen this formula measures the smaller angle between the vectors. Note that two vectors u and v areperpendicular precisely when u · v 0.4

2MatricesAt its simplest a matrix is just a two-dimensional array of numbers: for example µ¶µ¶10 0 1 2 3 , 1.2 ,0 02 π 0 1are all matrices. The examples above are respectively a 2 3 matrix, a 3 1 matrix and a 2 2 matrix(read ‘2 by 3’ etc.); the first figure refers to the number of rows and the second to the number of columns.So vectors like (x, y) and (x, y, z) are also matrices, respectively 1 2 and 1 3 matrices.The 3 1 matrix above could just as easily be thought of as a vector – it is after all just a list ofthree numbers, but written down rather than across. This is an example of a column vector. When weneed to differentiate between the two, the vectors we have already met like (x, y) and (x, y, z) are calledrow vectors.Notation 7 The set of 1 n row vectors (or n-tuples) is written as Rn . When we need to differentiatebetween row and column vectors we write (Rn )0 or (Rn ) for the set of n 1 column vectors. If there isno chance of confusion between the two (because we are only using row vectors, or only column vectors)then Rn can denote either set.Notation 8 If you are presented with an m n matrix A (aij ) then the notation here simply meansthat aij is the (i, j)th entry. That is, the entry in the ith row and jth column is aij . Note that i can varybetween 1 and m, and that j can vary between 1 and n. So a1j ith row (ai1 , . . . , ain ) and jth column . .amjNotation 9 As with vectors there is a zero m n matrix, whose every entry is 0, which we denote by 0unless we need to specify its size.2.1Algebra of MatricesWe shall see though that a matrix is much more than simply an array of numbers. Where vectors canbe thought of as points in space, we shall see that a matrix is really a map between spaces: specifically00a m n matrix can be thought of as a map from (Rn ) to (Rm ) . To see this we need to first talk abouthow matrices add and multiply.1. Addition: Let A be an m n matrix (recall: m rows and n columns) and B be an p q matrix.We would like to add them (as we added vectors) by adding their corresponding entries. So to addthem the two matrices have to be the same size, that is m p and n q. In which case we have(A B)ij aij bijfor 1 i m and 1 j n.2. Scalar Multiplication: Let A be an m n matrix and k be a constant (a scalar). Then thematrix kA has as its (i, j)th entry(kA)ij kaij for 1 i m and 1 j n.That is, we multiply each of the entries of A by k to get the new matrix kA.3. Matrix Multiplication: Based on how we added matrices then you might think that we multiplymatrices in a similar fashion, namely multiplying corresponding entries, but we do not. At firstglance the rule for multiplying matrices is going to seem rather odd, but we will soon discover whywe multiply them as we do.5

The rule is this: we can multiply an m n matrix A with an p q matrix B if n p and weproduce an m q matrix AB with (i, j)th entry(AB)ij nXk 1aik bkj for 1 i m and 1 j q.It may help a little to write the rows of A as r1 , . . . , rm and the columns of B as c1 , . . . , cq and theabove rule says that(AB)ij ri · cj for 1 i m and 1 j q.We dot the rows of A with the columns of B.This will, I am sure, seem pretty bizarre, let alone easy to remember – so here are some examples.Example 10 Show that 2 (A B) 2A 2B for the following matrices:µ¶µ¶1 20 2A , B .3 45 1Here we are checkingc (A B) cA cB. Butµ1A B 8µ22A 6the distributive law in a specificto check it here we note that¶µ02, and so 2 (A B) 516¶µ¶40 4, and 2B ,810 2example.010¶Generally it is the case that;so that 2A 2B µ2 016 10¶.Example 11 Where possible, calculate pairwise the products of the following matrices.µ¶µ¶µ¶1 21 2 31 1A , B , C . 1 03 2 11 1 {z} {z} {z}2 22 32 2First up, the products we can form are: AA, AB, AC, CA, CB, CC. Let’s slowly go through theproduct AC.¶ µ¶ µ¶µ¶µ1 1 2 1 ?3 ?121 1 .? ?1 1 1 0This is how we calculate the (1, 1)th entry of AC. We the first row of A and the first column of C andwe dot them together. We complete the remainder of the product as follows:µ¶µ¶ µ¶¶µ121 121 ( 1) 2 13 3 ;1 1? ? ? 1 0¶µ¶µ¶ µ¶µ12243 31 1 ; 1 01 1 1 1 0 1 ? 1 ?¶µ¶µ¶ µ¶µ122 43 31 1 . 1 01 10 ( 1) ( 1) 0 ( 1) 11So finallyµ1 120¶µ11 1 16¶ µ3 1 31¶.

We complete the remaining examples more quickly but still leaving a middle stage in the calculation tohelp see the process:µ¶µ¶ µ¶ µ¶1 21 21 22 0 1 2AA ; 1 0 1 0 1 0 2 0 1 2µ¶µ¶ µ¶ µ¶1 21 2 31 22 43 6246AB ; 1 03 2 1 1 0 2 0 3 0 1 2 3µ¶µ¶ µ¶ µ¶1 11 21 1 2 02 2CA ;1 1 1 01 1 2 02 2µ¶µ¶ µ¶ µ¶1 11 2 31 3 2 2 3 1 2 0 2CB ;1 13 2 11 3 2 2 3 1 2 0 2µ¶µ¶ µ¶ µ¶1 11 11 1 1 10 0CC .1 11 11 1 1 10 0N.B. There are certain important things to note here, which make matrix algebra different from thealgebra of numbers.1. Note the AC 6 CA. That is, matrix multiplication is not generally commutative.2. It is, though, associative, which means that(AB) C A (BC)whenever this product makes sense. So we can write down a product like A1 A2 . . . An without havingto specify how we go about multiplying all these matrices or needing to worry about bracketing.But we do have to keep the order in mind. We shall not prove this fact here.3. Note that CC 0 even though C is non-zero – not something that happens with numbers.4. The distributive laws also hold for matrix multiplication, namelyA (B C) AB AC and (A B) C AC BCwhenever these products make sense.Notation 12 We write A2 for the product AA and similarly we write An for the product AA· · · A}. Note {zn tim esthat A must be a square matrix (same number of rows and columns) for this to make sense.7

3Matrices as MapsWe have seen then how we can multiply an m n matrix A and an n p matrix B to form a productAB which is an m p matrix. Now given the co-ordinates of a point in n-dimensional space, we can put0them in a column to form a n 1 column vector, an element v (Rn ) . If we premultiply this vector vm 0by the m n matrix A we get a m 1 column vector Av (R ) .00So premultiplying by the matrix A gives a map: (Rn ) (Rm ) : v Av.Why have we started using column vectors all of a sudden? This is really just a matter of choice: wecould just as easily take row vectors and postmultiply by matrices on the right, and this is the conventionsome books choose. But, as we are used to writing functions on the left, we will use column vectors andpremultiply by matrices.Importantly though, we can now answer the question of why we choose to multiply matrices as we do.Take an m n matrix A and an n p matrix B. We have two maps associated with premultiplicationby A and B; let’s call them α, given by:00α : (Rn ) (Rm ) : v 7 Avand β, given by00β : (Rp ) (Rn ) : v 7 Bv.We also have their composition α β, that is we do β first and then α, given byα β : (Rp )0 (Rm )0 : v 7 A (Bv) .But we have already commented that matrix multiplication is associative, so thatA (Bv) (AB) v.That is,the composition α β is premultiplication by the product AB.So if we think of matrices more as maps, rather than just simple arrays of numbers, matrix multiplicationis quite natural and simply represents the composition of the corresponding maps.3.1Linear MapsLet A be an m n matrix and consider the associated mapα : (Rn )0 (Rm )0 : v 7 Avwhich is just pre-multiplication by A. Because of the distributive laws that hold for matrices, givencolumn vectors v1 , v2 (Rn )0 and scalars c1 , c2 R thenα (c1 v1 c2 v2 ) A (c1 v1 c2 v2 ) c1 Av1 c2 Av2 c1 α (v1 ) c2 α (v2 ) .This means α is what is called a linear map – multiplication by a matrix leads to a linear map. The00important thing is that converse also holds true – any linear map (Rn ) (Rm ) has an associatedmatrix.¡ 0¡ 0To see this most clearly we will return to 2 2 matrices. Let α : R2 R2 be a linear map – we’lltry to work out what its associated matrix is. Let’s suppose we’re right and α is just premultiplicationby some 2 2 matrix; let’s write it asµ¶a b.c d8

Note that if we multiply the canonical basis vectorsµ ¶µ ¶10i and j 01by this matrix we getµa bc d¶µ10¶ µac¶, andµa bc d¶µ01¶ µbd¶.So, if this matrix exists, the first α (i) and the second column is α (j) . But if we remember that α islinear then we see now that we have the right matrix, let’s call it¡ A α (i) α (j) .ThenAµxy¶ xα (i) yα (j) α (xi yj) [as α is linear]µ¶x α.yWe shall make use of this later when we calculate the matrices of some standard maps.The calculations we performed above work just as well generally: if α : (Rn )0 (Rm )0 is a linear mapthen it is the same as premultiplying by an m n matrix. In the columns of this matrix are the imagesof the canonical basis of Rn under α.9

4Simultaneous Linear Equations – 2 2 InversesSuppose we are given two linear equations in two variables x and y. These might have the form2x 3y 1(2)3x 2y 2(3)andTo have solved these in the past, you might have argued along the lines:eliminating x by considering 3 (2) 2 (3)simplifying:sosubstituting back in (2)solving:(6x 9y) (6x 4y) 3 4;5y 1;: y 0.2;: 2x 0.6 1;: x 0.8.So we see we have a unique solution: x 0.8, y 0.2.You may even have seen how this situation could be solved graphically by drawing the lines2x 3y 1 and 3x 2y 2;the solution then is their unique intersection.23x 2y 2-11 2x 3y 1-0.50.5-11H0.8 , 0.2 L1.52-22x 3y 1 and 3x 2y 2We can though, put the two equations (2) and (3) into matrix form. We do this by writingµ¶µ¶ µ ¶2 3x1 .3 2y2The two simultaneous equations in the scalar variables x and y have now been replaced by a singleequation in vector quantities – we have in this vector equation two 2 1 vectors (one on each side ofthe equation), and for the vector equation to be true both co-ordinates of the two vectors must agree.We know that it is possible to undo this equation to obtain the solutionµ¶ µ¶x0.8 y 0.2because we have already solved this system of equations. In fact there is a very natural way of unravellingthese equations using matrices.Definition 13 Let A be a 2 2 matrix. We say that B is an inverse of A ifµ¶1 0BA AB I2 .0 110

The matrix I2 is called the identity matrix – or more specifically it is the 2 2 identity matrix.There is an n n identity matrix which has 1s down the diagonal from top left to bottom right and0s elsewhere. The identity matrices have the property thatAIn A In Afor any n n matrix A. If an inverse B for A exists then it is unique. This is easy to show: suppose B and C were twoinverses then note thatC In C (BA) C B (AC) BIn B. We write A 1 for the inverse of A if an inverse exists. If BA In then, in fact, it will follow that AB In . The converse is also true. We will not provethis here.Proposition 14 The matrixA µa bc d¶has an inverse precisely when ad bc 6 0. If ad bc 6 0 thenµ¶1d bA 1 . c aad bcProof. Note for any values of a, b, c, d, thatµ¶µ¶ µ¶d ba bad bc0 (ad bc) I2 . c ac d0ad bcSo if ad bc 6 0 then we can divide by this scalar and we have found our inverse.But if ad bc 0 then we have found a matrixµ¶d bB c asuch thatBA 02the 2 2 zero matrix. Now if an inverse C for A existed, we’d have that02 02 C (BA) C B (AC) BI2 B.So each of a, b, c and d must be zero. So A 02 which makes it impossible for AC to be I2 – multiplyingany C by the 02 will always lead to 02 , not the identity.Let’s return now to a pair of simultaneous equations. Say they have the formax bycx dy k1 , k2 .Then these can be rewritten as a single vector equation:¶µ¶ µ¶µ¶ µxa bxk1.A yc dyk2If the matrix A has an inverse A 1 then we can premultiply both sides by this and we findµ¶µ¶µ¶µ¶xxxk1 1 1 I2 A A Ayyyk211

and we have found our unique solution.What happe

Week 1 – Vectors and Matrices . earl@maths.ox.ac.uk 1. Likewise in three (or higher) dimensions the triple (x,y,z) can be thought of as the point in R3,which is xunits along the x-axis, yunits along the y-axis and zunits along the z-axis, or it can represent the

Related Documents:

(prorated 13/week) week 1 & 2 156 week 3 130 week 4 117 week 5 104 week 6 91 week 7 78 week 8 65 week 9 52 week 10 39 week 11 26 week 12 13 17-WEEK SERIES* JOIN IN MEMBER PAYS (prorated 10.94/week) week 1 & 2 186.00 week 3 164.10 week 4 153.16 week 5 142.22 week 6 131.28 week 7 120.34

22 Dense matrices over the Real Double Field using NumPy435 23 Dense matrices over GF(2) using the M4RI library437 24 Dense matrices over F 2 for 2 16 using the M4RIE library447 25 Dense matrices over Z/ Z for 223 using LinBox’s Modular double 455 26 Dense matrices over Z/ Z for 211 using LinBox’s Modular&l

Lecture L3 - Vectors, Matrices and Coordinate Transformations By using vectors and defining appropriate operations between them, physical laws can often be written in a simple form. Since we will making extensive use of vectors in Dynamics, we will summarize some of their important properties. Vectors

I think of atomic vectors as “just the data” Atomic vectors are the building blocks for augmented vectors Augmented vectors Augmented vectors are atomic vectors with additional attributes attach

Week 3: Spotlight 21 Week 4 : Worksheet 22 Week 4: Spotlight 23 Week 5 : Worksheet 24 Week 5: Spotlight 25 Week 6 : Worksheet 26 Week 6: Spotlight 27 Week 7 : Worksheet 28 Week 7: Spotlight 29 Week 8 : Worksheet 30 Week 8: Spotlight 31 Week 9 : Worksheet 32 Week 9: Spotlight 33 Week 10 : Worksheet 34 Week 10: Spotlight 35 Week 11 : Worksheet 36 .

Class XII – NCERT – Maths Chapter 3 - Matrices 3.Matrices . Exercise 3.1 . Question 1: In the matrix 2 5 19 7 5 35 2 12 2 3 1 5 17. A . As the given matrices are equal, their corresponding elements are also equal. Class XII – NCERT – Maths . Chapter 3 - Matrices . 3.Matrices . Comparing the corresponding elements, we get: .

matrices with capital letters, like A, B, etc, although we will sometimes use lower case letters for one dimensional matrices (ie: 1 m or n 1 matrices). One dimensional matrices are often called vectors, as in row vector for a n 1 matrix or column vector for a 1 m matrix but we are going

Two nonparallel vectors always define a plane, and the angle is the angle between the vectors measured in that plane. Note that if both a and b are unit vectors, then kakkbk 1, and ab cos . So, in general if you want to find the cosine of the angle between two vectors a and b, first compute the unit vectors aˆ and bˆ in the directions of a .