Vector - HKUST CSE Dept.

L18: Vector—More
Operations
2012 Summer Math Course
for Direct Entry Students,
CSE Department, HKUST.
2012 Summer Math Course
1
Multiplication of vectors

We have learned addition, subtraction
and scalar multiplication of vectors.

There are two types of multiplication of
vectors:


Dot Product / Inner Product / Scalar Product:
The result is a scalar.
Cross Product / Vector Product:
The result is a vector.
2012 Summer Math Course
2
Dot product of vectors
The dot product of two non-zero vectors
a and b, denoted by a·b, is defined as
follows:
a·b=|a||b|cosθ,
where θ is the angle between a and b.
 If a=0 or b=0 then a·b=0 (as |0| = 0).

a
a
θ
b
θ
θ
b
2012 Summer Math Course
a
b
3
Dot product of vectors

Some properties:








a·b=b·a. (commutative)
a·a=|a|2.
a·(b c)=a·b a·c. (Distributive over Addition)
k(a·b)=(ka)·b=a·(kb)
If a is orthogonal/ perpendicular to b (a
then a·b=0.
If a·b=0, then a=0 or b=0 or a b.
i·j=j·k=k·i=0.
i·i=j·j=k·k=1.
2012 Summer Math Course
b),
4
Dot product of vectors

2
Dot product of vectors in R :
(a1i+b1j)·(a2i+b2j)
=a1a2+b1b2.
3

Dot product of vectors in R :
(a1i+b1j+c1k)·(a2i+b2j+c2k)
=a1a2+b1b2+c1c2.

Exercise: Prove the above equations.
2012 Summer Math Course
5
Exercise

Find the angle between 3i+4j and -2i+8j.


Method 1: by cosine law
Method 2: by dot product

Show that 4i-2j+6k and 7i+2j-4k are
perpendicular.

Find the projection vector of -5i+17j on
the direction 6i+8j.
2012 Summer Math Course
6
Cross product of vectors

The cross product of two non-zero
vectors a and b is defined by
a b=|a||b|sinθ n̂ , where



n̂ is the unit vector perpendicular to the plane
containing a and b.
θ is the angle between a and b.
a, b and n̂ form a right-hand system. a
a×b
b
n̂
θ

a

2012 Summer Math Course
θ
n̂
a×b
b
7
Cross product of vectors
Note a b is a vector, and a·b is a scalar.
 Some properties:










a b=-(b a). (anti-commutative)
a a=0.
a (b c)=a b a c. (Distributive over Addition)
k(a×b)=(ka)×b=a×(kb).
If a is parallel to b (a // b), then a b=0.
If a b=0, then a=0 or b=0 or a // b.
i×i=j×j=k×k=0.
i×j=k, j×k=i, k×i=j.
Note a b=a c does NOT imply b=c.
2012 Summer Math Course
8
Cross product of vectors
3
Cross product can only be done in R .
3
 Cross product of vectors in R :
(a1i+b1j+c1k)×(a2i+b2j+c2k)
=(b1c2-b2c1)i-(a1c2-a2c1)j+(a1b2-a2b1)k.


Exercise: Prove the above equation.
2012 Summer Math Course
9
Find the area by cross product
|a b| is area of the parallelogram with
adjacent sides a and b.
 (1/2)|a b| is area of the triangle with
adjacent sides a and b.

b
a
Area of the
parallelogram
= |a×b|.
2012 Summer Math Course
10
Exercises

Let a=i+j-k and b=i-j+2k, find a·b and
a×b.

Find a unit normal of the plane formed by
2i+3j and 4i-2j+5k.

Show that the planar equation with normal
vector n=ai+bj+ck is ax+by+cz=d.
2012 Summer Math Course
11
Scalar triple product
a·(b×c) is called scalar triple product.
 The volume of parallelepiped with edges a,
b and c, V=a·(b×c).

Volume of the
Parallelepiped,
V= a·(b×c).
a
c
b
2012 Summer Math Course
12
Exercise

If a = i-2j+3k, b = 5i+6j-k, c = b x a,
what is:




a) a·c
b) (2a-4b)·c
c) a unit vector of (a+3b) x a
Show that i-2j+3k, 5i+6j-k and 3i+2j+k
are on the same plane.


Method 1: by the normal vector of the plane.
Method 2: by scalar triple product.
2012 Summer Math Course
13
General definition of vector in R

x =(x1,x2,x3) is vector in R





n
3
x1,x2,x3 are variables
Each entry can represent arbitrary thing
E.g. number of white, black, and red balls
E.g. (a,b,c) represents ax2+bx+c
3
We usually write vector in R by:
or
2012 Summer Math Course
14
General definition of vector in R
n
4
Generally, a vector in R can be
written as x=(x1, x2, x3, x4).
n
 A vector in R then can be written as

x=(x1, x2, x3, …, xn) or








x1 

x2 
x 3 .

 

xn 
2012 Summer Math Course
15
General definition of vector in R
n
n
Any vector in R must follow:
 Vector Addition and Subtraction:



Let ai and bi, 1≤i≤n, be real numbers.
(a1, a2, …, an b1, b2, …, bn)
= (a1 b1, a2 b2, …, an bn).

(a1, a2, …, an)-(b1, b2, …, bn)
= (a1-b1, a2-b2, …, an-bn).
 Scalar Multiplication:

k(a1, a2, …, an
(k a1, k a2, …, k an
2012 Summer Math Course
16
General definition of vector in R
n

Usually, we define the magnitude of
n
vector in R by:

Define inner product by:

Note that it is not necessary to define
magnitude and inner product in this way.
2012 Summer Math Course
17
Vector as a one-dimensional array

Previously, vectors in 2D and 3D are
defined by magnitude and direction.

The general definition of vector tells us
that, vector is a list of numbers.

It is convenient to use vector to represent
similar things in computer (array).
2012 Summer Math Course
18
Vector as a one-dimensional array
Suppose a cup of mixed juice X contains 3
litres of orange juice, 1 litre of apple juice
and 1 litre of pear juice. We represent
mixed juice X as a vector (3, 1, 1).
 Assume another cup of mixed juice Y is
represented as (2, 2, 1).
 When we mix the two cups together, in
the mixture, the vector representing the
mixture = X+Y
=(3, 1, 1)+(2, 2, 1)=(5, 3, 2).
(by vector addition)

2012 Summer Math Course
19
Vector as a one-dimensional array
When we divide the mixture into two cups,
the vector representing each cup, say Z
=0.5 x (5, 3, 2)=(2.5, 1.5, 1).
(By scalar multiplication)
 Note that Z contains 2.5 litres of orange
juice, 1.5 litres of apple juice, 1 litre of
pear juice.
 In this example, it is much more
convenient to use vector representation.

2012 Summer Math Course
20
Matrix as a two-dimensional array
Suppose we want to represent all the
marks of mid-term exam for 2 students in
3 subjects.
 It is common to represent this by a table.
For example:

Calvin
Chinese
70
English
72
Math
80
Simon
81
78
75
2012 Summer Math Course
21
Matrix as a two-dimensional array

Mathematically, we can represent the
table using matrix: (in rectangle/bracket)
 70
M  
 81

72
78
80 
 70
 , or 
75 
 81
72
78
80 

75 
Then, we may have another matrix to
represent the score in final exam:
 73
F  
 82
74
77
79 
.
78 
2012 Summer Math Course
22
Matrix as a two-dimensional array

Assume the weight of mid-term and final
are the same, the overall score,
O 
1
(M  F )
2
1   70
 
2   81
1  143
 
2  163
72
78
146
155
80   73

75   82
74
77
159    71 . 5
   
153    81 . 5
2012 Summer Math Course
79  
 
78  
73
77 . 5
79 . 5 
.
76 . 5 
23