Unit 2: Vectors and Dot Product: Math S-21A
Unit 2: Vectors and Dot Product: Math S-21A
MATH S-21A
Lecture
x−a
2.1. Two points P = (a, b, c) and Q = (x, y, z) in R3 define a vector ~v = y − b .
z−c
We simply write this column vector also as a row vector [x − a, y − b, z − c] or in order
to save space. As the vector starts at P to Q we write ~v = P~Q. The real numbers
numbers p, q, r in ~v = [p, q, r] are called the components of ~v .
2.2. Vectors can be placed anywhere in space. 1 Two vectors with the same com-
ponents are considered equal. Vectors can be translated into each other if their com-
ponents are the same. If a vector ~v starts at the origin O = (0, 0, 0), then ~v = [p, q, r]
heads to the point (p, q, r). One can therefore identify points P = (a, b, c) with vec-
tors ~v = [a, b, c] attached to the origin. For clarity, we often draw an arrow~ on top of
a vector variable and if ~v = P~Q then P is the ”tail” and Q is the ”head” of the vector.
To distinguish vectors from points, it is custom to write [2, 3, 4] for vectors and (2, 3, 4)
for points.
2.3.
Definition: The sum of two vectors is ~u +~v = [u1 , u2 ]+[v1 , v2 ] = [u1 +v1 , u2 +
v2 ]. The scalar multiple is λ~u = λ[u1 , u2 ] = [λu1 , λu2 ]. The difference ~u − ~v
can best be seen as the addition of ~u and (−1) · ~v .
2.4. The vectors ~i = [1, 0, 0], ~j = [0, 1, 0], ~k = [0, 0, 1] are called standard basis
vectors. We will avoid this notation mostly but it has historically grown as some
notions like the dot and cross product have grown from quaternions which are points
(t, x, y, z) in R4 usually written as t + ix + jy + kz.
2.5.
Definition: The length |~v | of a vector ~v = P~Q is defined as the distance
d(P, Q) from P to Q. A vector of length 1 is called a unit vector. If ~v 6= ~0,
then ~v /|~v | is called a direction of ~v . The only vector of length 0 is the 0 vector
[0, 0, 0].
2.6.
Definition: The dot product of two vectors ~v = [a, b, c] and w
~ = [p, q, r] is
defined as ~v · w
~ = ap + bq + cr.
2.7. Different notations for the dot product are used in different mathematical fields.
While mathematicians write ~v · w ~ the Dirac notation h~v |wi
~ = (~v , w), ~ is used in
quantum mechanics or the Einstein notation vi wi or more generally gij v i wj in general
relativity is used. In statistics, it is called the covariance Cov[v, w] of centered data
points. The dot product is also called scalar product or inner product. It could be
generalized. Any product g(v, w) which is linear in v and w and satisfies the symmetry
g(v, w) = g(w, v) and g(v, v) ≥ 0 and g(v, v) = 0 if and only if v = 0 can be used as a
dot product. An example is g(v, w) = 2v1 w1 + 3v2 w2 + 5v3 w3 .
2.8. The dot product determines distances and distances determines the dot product.
Proof:√ Write v = ~v . Using the dot product one can express the length of v as
|v| = v · v. On the other hand, from (v + w) · (v + w) = v · v + w · w + 2(v · w) can
be solved for v · w:
v · w = (|v + w|2 − |v|2 − |w|2 )/2 .
Theorem: |~v · w|
~ ≤ |~v ||w|.
~
Proof. If |w| = 0, the statement holds as both sides are zero. Otherwise, assume
|w| = 1 by dividing the equation by |w|. Now plug in a = v · w into the equation
0 ≤ (v −aw)·(v −aw) to get 0 ≤ (v −(v ·w)w)·(v −(v ·w)w) = |v|2 +(v ·w)2 −2(v ·w)2 =
|v|2 − (v · w)2 which means (v · w)2 ≤ |v|2 .
2.10. Having established this, it is possible to give a definition of what an angle is,
without referring to any geometric pictures:
2.11. The Al Kashi’s theorem gives the third side length c of a triangle ABC in
terms of the sides a = d(B, C), b = d(A, C) and α, the angle at the vertex C
Proof. |~u +~v |2 = (~u +~v )·(~u +~v ) = ~u2 +~v 2 +2~u ·~v ≤ ~u2 +~v 2 +2|~u ·~v | ≤ ~u2 +~v 2 +2|~u|·|~v | =
(|~u| + |~v |)2 .
Proof. (~v − w)
~ · (~v − w)
~ = ~v · ~v + w
~ ·w
~ + 2~v · w
~ = ~v · ~v + w
~ · w.
~
2.14.
·w
Definition: The vector P(~v ) = |~vw| ~
~ 2
w
~ is called the projection of ~v onto w.
~ The
~v ·w
~
scalar projection |w| ~
is a signed length of the vector projection. Its absolute
value is the length of the projection of ~v onto w. ~ The vector ~b = ~v − P (~v ) is a
vector orthogonal to the w-direction.
~
2.15. The projection allows to visualize the dot product. The absolute value of the
dot product is the length of the projection. The dot product is positive if v points
more towards to w, it is negative if v points away from it. In the next lecture we use
the projection to compute distances between various objects.
Examples
2.16.√For example, with ~v = [0, −1, 1], w
~ = [1, −1, 0], P(~v ) = [1/2, −1/2, 0]. Its length
is 1/ 2.
2.17. The RGB color space consists of triples ~v = [r, g, b] describing the amount of
red, green and blue of a color. An other coordinate system is the CMY color space
consisting of triples ~v = [c, m, y] = [1 − r, 1 − g, 1 − b], where c is cyan, m is magenta
and y is yellow.
2.18. In physics, forces and fields F~ are described by vectors. The velocity of a curve
r(t) = [x(t), y(t), z(t)] is a vector attached to the point r(t).
2.19. In probability theory, data are described by vectors. One calls them also ran-
dom variables. It is in statistics, where higher dimensional spaces appear.
Multivariable Calculus
Homework
This homework is due on Tuesday, 6/30/2020.
Problem 2.5: a) Find the angle between the main diagonal of the unit
cube and one of the face diagonals. Assume that both diagonals pass
through a common vertex.
b) Find the vector projection of the main diagonal ~v = [1, 1, 1] onto the
side diagonal w
~ = [1, 1, 0].
c) Find the maximal distance between the 16 points (±1, ±1, ±1, ±1) of
a tesseract.
Postscript: Coordinates and Data
2.20. We live in a time, where data are increasingly important. This is good news
for multi-variable calculus, as data points are usually given as points in an Euclidean
space and analyzed using tools of multi-variable calculus. There are various ways how
data can be stored, in a computer as lists of bits, in a quantum computer as a list of
qbits, in a relational database as a list of tables, in a graph data base as a list of
graphs. A sort of graph database has been designed already by the Incas in the form
of Khipu, which are also called “talking knots”. In a picture, data are color values
attached in an array, a song is an array of amplitudes, a movie is an array of pictures,
which each is an array of color vectors. It does not matter, in the end, we can store
information as a point in a Euclidean space. The Harvard Khipu data base for example
is a standard relational database encoding the three dimensional knots which are still
available. We look here at an example, which illustrates the story of data:
2.21. The next table shows some data from the 2018 rankings of the top universities.
The data were obtained from the website
There are different such rankings. It is important that you are aware about how
arbitrary such a “ranking” can be done. This is especially if you think about how
the data were actually obtained. Which of the data can be considered objectively
reproducible, which ones are more subjective?
2.22. The following concrete data provide for each institution a vector:
2.24. Obviously, the overall ranking depends on the key. There is a ranking key so
that the university UCL is on the top for example. Can you find one? This requires
to find a ranking vector ~v for which ~x · ~v is maximal for UCL.
Multivariable Calculus
2.25. How can we visualize data? In the next figure, we plot three relevant data
points given by
~x = [Academic, F aculty − StudentRatio, Citations]
By comparing the data with the plot, can you figure out, what each of the coordinate
axes is? Also this visual representation produces some kind of ranking. Being a gradu-
ate of ETH myself and being at Harvard, having been at Caltech, the picture has been
turned so that these universities look particularly good ... It is important that you are
aware of such manipulations. They are everywhere!