CS131 Part I, Number Systems CS131 Mathematics for Computer Scientists II Note 3 VECTRS Vectors in two and three dimensional space are defined to be members of the sets R 2 and R 3 defined by: R 2 = {(x, y) x, y R} R 3 = {(x, y, z) x, y, z R} Members of R 2 can be thought of as points in a plane while members of R 3 can be thought of as points in three dimensional space. Addition and scalar multiplication of vectors are defined in the following way: (1) If a = (a 1, a 2 ) R 2, b = (b 1, b 2 ) R 2 and λ R then a + b and λ a are defined by:- a + b = (a 1 + b 1, a 2 + b 2 ) and λ a = (λ a 1, λ a 2 ) (2) If a = (a 1, a 2, a 3 ) R 3, b = (b 1, b 2, b 3 ) R 3 and λ R then a + b = (a 1 + b 1, a 2 + b 2, a 3 + b 3 ) and λ a = (λ a 1, λ a 2, λ a 3 ) We also define a to be ( 1)a and a b to be a + ( b) Vectors in R 2 have the following geometric interpretation. If p = (p 1, p 2 ) R 2, we identify p with the directed line segment P starting at the origin and ending at the point P and write P = p The vector p is called the position vector of the point P. Two directed line segments are regarded as equivalent if they have the same length and point in the same direction. If points A and B have position vectors a and b respectively then AB = b a P(p 1, p 2 ) B(b 1, b 2 ) A(a 1, a 2 ) 3 1 Here we have AB = P if and only if P is the point with coordinates (b 1 a 1, b 2 a 2 ) i.e. AB = P = b a
Geometrically the sum a + b has the following interpretation: if a is the position vector of the point A and b is the position vector of B then c = a+b is the position vector of the point C for which ACB is a parallelogram. A a b B b C a a + b Move one directed line segment to a parallel position where its tail coincides with the head of the other. Join up the other tail and head to form the directed line segment representing the sum. Multiplying by a constant changes the length of a directed line segment. A positive multiplier maintains direction while a negative multiplier reverses it. a 2a a b 3 2 a a a b a b b Length and Distance If a = (a 1, a 2 ) R 2 then we define the length a of a by a = a1 2 + a2 2 Similarly if a = (a 1, a 2, a 3 ) R 3, then we define the length of a a = a1 2 + a2 2 + a2 3 A vector is called a unit vector if its length is 1. The distance between a and b is defined to be b a Problem. (2, 1). Find the unit vector in R 2 which has the same direction as Solution We have (2, 1) = 4 + 1 = 5 so 1 5 (2, 1) = 1 3 2
Hence (2/ 5, 1/ 5) is a unit vector with the same direction as (2, 1). This process is also known as normalisation Scalar product. The scalar product (or dot product) of two vectors a = (a 1, a 2 ) and b = (b 1, b 2 ) in R 2 is the number a.b defined by a.b = a 1 b 1 + a 2 b 2 B b = (b 1, b 2 ) A β a = (a 1, a 2 ) α sin α = a 2 a cos α = a 1 a sin β = b 2 b sin β = b 1 b Suppose that a and b are the position vectors of A and B. Let α and β be the angles made by A and B (respectively) with the x-axis. Then the angle θ between the two directed line segments satisfies cos θ = cos(β α) = cos β cos α + sin β sin α = a 1b 1 + a 2 b 2. a b (Reminder: cos(x + y) = cos(x) cos(y) sin(x) sin(y), sin( x) = sin(x), cos( x) = cos(x).) The scalar (dot) product of vectors a = (a 1, a 2 ), b = (b 1, b 2 ) in R 2 is a.b = a 1 b 1 + a 2 b 2 = a b cos θ where θ is the angle between a and b. Two vectors are orthogonal or perpendicular if their scalar product is 0. Problem. Find the angle between the vectors (4, 2) and (9, 3) in R 2. Solution. Let a = (4, 2) and b = (9, 3) then a.b = 4 9 + ( 2) 3 = 30, a = 4 2 + ( 2) 2 = 20, b = 9 2 + 3 2 = 90 so the angle θ satisfies 30 = 20 90 cos θ or 30 cos θ = = 1 2 900 2 and hence θ = π/4 Problem. Find the set of all vectors in R 2 which are orthogonal to (2, 1). 3 3
Solution. For any vector (x, y) we have (x, y).(2, 1) = 0 2x + y = 0 y = 2x so the set of all vectors orthogonal to (2, 1) is {(x, 2x) x R}. Geometrically these are the position vectors of points which lie on the straight line y = 2x which is perpendicular to the line joining (0, 0) and (2, 1). As well as vectors in two and three dimensional space we can define an n-dimensional space R n where n is any fixed positive integer. A vector in this space is a list of n real numbers. Thus: R n = {(x 1, x 2,..., x n ) x 1, x 2,..., x n R}. If a = (a 1, a 2,..., a n ) R n b = (b 1, b 2,..., b n ) R n and λ R we define a + b = (a 1 + b 1, a 2 + b 2,..., a n + b n ) λ a = (λ a 1, λ a 2,..., λ a n ) a = a 2 1 + a2 2 + + a2 n a.b = a 1 b 1 + a 2 b 2 + + a n b n The distance between a, b R n is defined to be b a. We say that a R n is a unit vector if a = 1 and that a, b R n are orthogonal if a.b = 0 The zero vector in R n is the vector 0 = (0, 0,..., 0) whose components are all 0 This generalisation to n dimensions is useful in problems involving a number of simultaneous equations which can be written as a single vector equation. It also allows us to deal with common properties of two and three dimensional space at the same time. When n = 1 then vectors in R 1 just have a single component and we can identify R 1 with the real line R. In R 3 as well as R 2 we have a.b = a b cos θ where θ is the angle between a and b. Problem. If a = (2, 1, 3, 1) and b = ( 1, 2, 1, 2) find (i) the length of 2a + b, (ii) the distance between a and b. 3 4
Solution. We have 2a + b = (4, 2, 6, 2) + ( 1, 2, 1, 2) = (3, 0, 7, 4) so 2a + b = 3 2 + 0 2 + 7 2 + 4 2 = 9 + 49 + 16 = 74 The distance between a and b is b a = ( 1, 2, 1, 2) (2, 1, 3, 1) = ( 3, 3, 2, 1) = 9 + 9 + 4 + 1 = 23 ABSTRACT Content Vectors, definition, addition and subtraction, length, distance, scalar product, n dimensional vectors. In this Note we study vectors, entities which have the important properties of magnitude and direction expressed as a single mathematical variable. These are useful for dealing with physical quantities such as velocity, acceleration, force and displacement each of which consists of a magnitude and a direction. Mathematics has borrowed the term vector for use in many other abstract senses not necessarily connected with any physical properties. These other senses include representation of points in space and the solution of a system of linear equations. History The founder of vector analysis was liver Heaviside (1850-1925) and he introduced the idea of using functions of a vector in one of his works on electromagnetism in 1885. In 1901 Heaviside predicted the existence of a reflecting ionised region surrounding the earth. The existence of the layer was later confirmed and is now called the ionosphere. 3 5