← Back to Math 010

3.2 Norm, Dot Product, and Distance in Rⁿ: Class Notes

Definition

If 𝐯=(v1,v2,…,vn) is a vector in Rn, then the norm of 𝐯 (also called its length or magnitude) is denoted by ‖𝐯‖ [by this author], and is defined by the formula ‖𝐯‖=v12+v22+⋯+vn2.

Theorem 3.2.1 Properties of the norm of a vector

If 𝐯 is a vector in Rn and k is any scalar, then:

a) ‖𝐯‖≥0

b) ‖𝐯‖=0 if and only if 𝐯=𝟎

c) ‖k𝐯‖=|k|‖𝐯‖

Proof of (c)

Let v→=(v1,v2,…,vn).

kv→=(kv1,kv2,…,kvn)(definition of scalar multiplication)‖kv→‖=k2v12+k2v22+⋯+k2vn2(definition of norm)=k2v12+v22+⋯+vn2=|k|‖v→‖(definition of absolute value)

(The last step uses k2=|k|.)

Definition

The norm of a unit vector is 1. We can obtain a unit vector from a nonzero vector 𝐯 by multiplying by the reciprocal of its length. This process is called normalizing the vector.

1‖v→‖v→=v→‖v→‖ is a unit vector.

#1

Find the norm of 𝐯 and a unit vector that is oppositely directed to 𝐯.

a. 𝐯=(2,2,2)

b. 𝐯=(1,0,2,1,3)

Solution

a. v→=(2,2,2)=2(1,1,1), so

‖v→‖=212+12+12=23.

Multiply by −1‖v→‖: the negative sign reverses the direction and dividing by the norm makes the length 1.

−123v→=(−13,−13,−13)

This has length 1 and is oppositely directed to v→.

Answer: ‖v→‖=23,  (−13,−13,−13)

b.

‖v→‖=1+0+4+1+9=15

−115(1,0,2,1,3)=(−115,0,−215,−115,−315)

Answer: ‖v→‖=15,  (−115,0,−215,−115,−315)

Definition

The standard unit vectors in 𝐑𝐧 are the standard basis vectors for Rn, 𝐞1=(1,0,0,…,0), 𝐞2=(0,1,0,…,0), …, 𝐞n=(0,0,0,…,1).

Recall

In R2: e→1=(1,0)=ı^, e→2=(0,1)=ȷ^.

In R3: e→1=(1,0,0)=ı^, e→2=(0,1,0)=ȷ^, e→3=(0,0,1)=k^.

Every vector v→=(v1,v2,…,vn) in Rn can be expressed as a linear combination of the standard basis vectors:

v→=v1e→1+v2e→2+⋯+vne→n.

Definition

If 𝐮=(u1,u2,…,un) and 𝐯=(v1,v2,…,vn) are points in Rn, then we denote the distance between 𝐮 and 𝐯 by d(𝐮,𝐯) and define it to be

d(𝐮,𝐯)=‖𝐮−𝐯‖=(u1−v1)2+(u2−v2)2+⋯+(un−vn)2

#4

Evaluate the given expression with 𝐮=(2,−2,3), 𝐯=(1,−3,4), and 𝐰=(3,6,−4).

a. ‖𝐮+𝐯+𝐰‖

b. ‖𝐮−𝐯‖

c. ‖3𝐯‖−3‖𝐯‖

d. ‖𝐮‖−‖𝐯‖

Solution

a.

u→+v→+w→=(2+1+3,−2−3+6,3+4−4)=(6,1,3),

so

‖u→+v→+w→‖=36+1+9=46.

Answer: 46

b. Note: this is the distance between u→ and v→, d(u→,v→).

‖u→−v→‖=(2−1)2+(−2+3)2+(3−4)2=12+12+(−1)2=3

Answer: 3

c. By Theorem 3.2.1(c), ‖3v→‖=3‖v→‖, so

‖3v→‖−3‖v→‖=3‖v→‖−3‖v→‖=0.

(Numerically, ‖v→‖=1+9+16=26 and 326−326=0.)

Answer: 0

d.

‖u→‖−‖v→‖=4+4+9−1+9+16=17−26

Answer: 17−26

Definition

Let 𝐮 and 𝐯 be nonzero vectors in Rn positioned so that their initial points coincide. The angle between 𝐮 and 𝐯 is the angle θ determined by 𝐮 and 𝐯 such that 0≤θ≤π.

Two vectors u and v drawn from a common initial point, with the angle theta between them

u→ and v→ start at the same point; θ is the angle between them.

Definition

If 𝐮 and 𝐯 are nonzero vectors in R2 or R3, and if θ is the angle between 𝐮 and 𝐯, then the dot product or Euclidean inner product of 𝐮 and 𝐯 is denoted by 𝐮·𝐯 and is defined as 𝐮·𝐯=‖𝐮‖‖𝐯‖cos⁡θ. If 𝐮=𝟎 or 𝐯=𝟎, then we define 𝐮·𝐯 to be 0.

Tip: For numbers, 3(x), 3x, 3×x, and 3·x all mean the same product. In u→·v→ the dot is required.

Definition

If 𝐮=(u1,u2,…,un) and 𝐯=(v1,v2,…,vn) are vectors in Rn, then the dot product or Euclidean inner product of 𝐮 and 𝐯 is denoted by 𝐮·𝐯 and is defined by 𝐮·𝐯=u1v1+u2v2+⋯+unvn.

To connect the two definitions, let u→ and v→ share an initial point in R3, and let Q and P be their terminal points, respectively.

Triangle formed by u, v, and the vector PQ = u minus v joining their tips, with angle theta between u and v

u→ ends at Q and v→ ends at P, with angle θ between them. The third side, PQ→=u→−v→, has length ‖u→−v→‖. The other two sides have lengths ‖u→‖ and ‖v→‖.

Recall: Law of Cosines

Triangle with vertices A, B, C and opposite sides a, b, c

Side c is opposite angle C, side a opposite A, and side b opposite B.

c2=a2+b2−2abcos⁡C

By the Law of Cosines,

‖u→−v→‖2=‖u→‖2+‖v→‖2−2‖u→‖‖v→‖cos⁡θ.

Write the left side and the squared norms in components:

(u1−v1)2+(u2−v2)2+(u3−v3)2=u12+u22+u32+v12+v22+v32−2‖u→‖‖v→‖cos⁡θ.

Each square on the left expands, e.g. (u1−v1)2=u12−2u1v1+v12. The squared terms appear on both sides and cancel, leaving

−2(u1v1+u2v2+u3v3)=−2‖u→‖‖v→‖cos⁡θ‖u→‖‖v→‖cos⁡θ=u1v1+u2v2+u3v3=u→·v→.

So the two definitions agree in R3. In R2 the same argument gives just u1v1+u2v2.

#10

Find 𝐮·𝐯, 𝐮·𝐮, and 𝐯·𝐯.

a. 𝐮=(1,1,−2,3), 𝐯=(−1,0,5,1)

b. 𝐮=(2,−1,1,0,−2), 𝐯=(1,2,2,2,1)

Solution

a.

u→·v→=1(−1)+1(0)−2(5)+3(1)=−8u→·u→=1(1)+1(1)−2(−2)+3(3)=15v→·v→=−1(−1)+0(0)+5(5)+1(1)=27

Answer: u→·v→=−8,  u→·u→=15,  v→·v→=27

b.

u→·v→=2(1)−1(2)+1(2)+0(2)−2(1)=0u→·u→=22+(−1)2+12+02+(−2)2=10v→·v→=12+22+22+22+12=14

Notice u→·u→=‖u→‖2.

Answer: u→·v→=0,  u→·u→=10,  v→·v→=14

#11

Find the Euclidean distance between 𝐮 and 𝐯 and the cosine of the angle between those vectors. State whether that angle is acute, obtuse, or 90∘.

a. 𝐮=(3,3,3), 𝐯=(1,0,4)

b. 𝐮=(0,−2,−1,1), 𝐯=(−3,2,4,4)

Solution

From the definition, u→·v→=‖u→‖‖v→‖cos⁡θ, so cos⁡θ=u→·v→‖u→‖‖v→‖.

a.

d(u→,v→)=(3−1)2+(3−0)2+(3−4)2=4+9+1=14

‖u→‖=33,‖v→‖=17,u→·v→=3(1)+3(0)+3(4)=15

cos⁡θ=153317=551

Since cos⁡θ>0, 0<θ<π/2: the angle is acute.

Answer: d=14,  cos⁡θ=551, acute

Tip: On the unit circle, cos⁡θ>0 on the right half (angles between 0 and π/2) and cos⁡θ<0 on the left half (angles between π/2 and π).

b.

d(u→,v→)=9+16+25+9=59

‖u→‖=6,‖v→‖=35,u→·v→=−4

cos⁡θ=−46·35=−4330<0 ⇒ π/2<θ<π

Answer: d=59,  cos⁡θ=−4330, obtuse

Theorem 3.2.2 Properties of the dot product

If 𝐮, 𝐯, and 𝐰 are vectors in Rn and if k is a scalar, then:

a) 𝐮·𝐯=𝐯·𝐮 (symmetry property)

b) 𝐮·(𝐯+𝐰)=𝐮·𝐯+𝐮·𝐰 (distributive property)

c) k(𝐮·𝐯)=(k𝐮)·𝐯 (homogeneity property)

d) 𝐯·𝐯≥0 and 𝐯·𝐯=0 if and only if 𝐯=𝟎 (positivity property)

Proof of (b)

Let u→=(u1,…,un), v→=(v1,…,vn), and w→=(w1,…,wn).

u→·(v→+w→)=(u1,u2,…,un)·(v1+w1,v2+w2,…,vn+wn)=definition of vector addition=u1(v1+w1)+u2(v2+w2)+⋯+un(vn+wn)=definition of dot product=u1v1+u1w1+⋯+unvn+unwn=distributive property of real numbers=u1v1+⋯+unvn+u1w1+⋯+unwn=commutative property of real numbers=u→·v→+u→·w→=definition of dot product

Theorem 3.2.3 More properties of the dot product

If 𝐮, 𝐯, and 𝐰 are vectors in Rn and if k is a scalar, then:

a) 𝟎·𝐯=𝐯·𝟎=0

b) (𝐮+𝐯)·𝐰=𝐮·𝐰+𝐯·𝐰

c) 𝐮·(𝐯−𝐰)=𝐮·𝐯−𝐮·𝐰

d) (𝐮−𝐯)·𝐰=𝐮·𝐰−𝐯·𝐰

e) k(𝐮·𝐯)=𝐮·(k𝐯)

Theorem 3.2.4 Cauchy-Schwarz Inequality

If 𝐮=(u1,u2,…,un) and 𝐯=(v1,v2,…,vn) are vectors in Rn, then |𝐮·𝐯|≤‖𝐮‖‖𝐯‖ or in terms of components

|u1v1+u2v2+⋯+unvn|≤(u12+u22+⋯+un2)1/2(v12+v22+⋯+vn2)1/2.

This is a necessary result for the cosine definition of the dot product in Rn:

|u→·v→|≤‖u→‖‖v→‖⇒|u→·v→|‖u→‖‖v→‖≤1⇒−1≤u→·v→‖u→‖‖v→‖≤1,

so cos⁡θ=u→·v→‖u→‖‖v→‖ always gives a value between −1 and 1, and the angle θ makes sense in Rn.

Theorem 3.2.5 Triangle Inequalities

If 𝐮, 𝐯, and 𝐰 are vectors in Rn, then:

a) ‖𝐮+𝐯‖≤‖𝐮‖+‖𝐯‖ (triangle inequality for vectors)

b) d(𝐮,𝐯)≤d(𝐮,𝐰)+d(𝐰,𝐯) (triangle inequality for distances)

Triangle formed by u, v placed tip to tail, and u + v

u→ and v→ placed tip to tail, with u→+v→ as the third side. A side of a triangle is never longer than the other two sides combined.

Proof of (a)

‖u→+v→‖2=(u→+v→)·(u→+v→)=u→·u→+2u→·v→+v→·v→≤‖u→‖2+2|u→·v→|+‖v→‖2

(by the definitions of norm and dot product and a property of absolute value: u→·v→≤|u→·v→|)

≤‖u→‖2+2‖u→‖‖v→‖+‖v→‖2=(‖u→‖+‖v→‖)2

(by the Cauchy-Schwarz inequality). Taking square roots yields ‖u→+v→‖≤‖u→‖+‖v→‖.

Proof of (b)

Part (b) follows from part (a) and the definition of distance.

Note: An expression like u→·v→·w→ does not have meaning (u→·v→ is a number, and a number can’t be dotted with a vector). But we can consider matrix multiplication using the dot product: if A is an n×n matrix and u→ and v→ are n×1 matrices, then

Au→·v→=v→T(Au→)=(v→TA)u→=(ATv→)Tu→=u→·ATv→.

(Sizes: v→T is 1×n and Au→ is n×1; v→TA and (ATv→)T are 1×n; ATv→ is n×1.)

So Au→·v→=u→·ATv→.Likewise, u→·Av→=ATu→·v→.

Last note: If we represent A (m×n) by its rows and B (n×r) by its columns,

A=[r→1r→2⋮r→m]andB=[c→1c→2⋯c→r],

then each entry of AB is a dot product of a row of A with a column of B:

AB=[r→1·c→1r→1·c→2⋯r→1·c→rr→2·c→1r→2·c→2⋯r→2·c→r⋮⋮⋮r→m·c→1r→m·c→2⋯r→m·c→r]