Vectors: Introduction & Geometric Intuition

3089 words
15 min read
Python Week 1: the first filter for runtime behavior
Visual companion
Python
Type and operator map

Python Week 1: the first filter for runtime behavior

View
Revision summary

What this note is really saying

Short form

# Vectors: Introduction & Geometric Intuition ## ๐ŸŽฏ Learning Objectives After this topic you will be able to: - Visualise a vector as a directed arrow in 2D/3D and interpret it as an $n$\-tuple of real numbers - Add vectors geometrically (tip-to-tail) and algebraically component-wise - Multiply a vector by a scalar...

Vectors: Introduction & Geometric Intuition

๐ŸŽฏ Learning Objectives

After this topic you will be able to:
  • Visualise a vector as a directed arrow in 2D/3D and interpret it as an nn-tuple of real numbers
  • Add vectors geometrically (tip-to-tail) and algebraically component-wise
  • Multiply a vector by a scalar and explain how it stretches or flips the arrow
  • Compute the dot product of two vectors in Rn\mathbb{R}^n and use it to find the angle between them
  • Compute the cross product of two vectors in R3\mathbb{R}^3 and interpret it geometrically
  • Decompose a vector into components parallel and perpendicular to another vector

๐Ÿ“‹ Prerequisites

  • Basic algebra: arithmetic with real numbers, solving simple equations
  • Coordinate geometry (from BSMA1001): plotting points (x,y)(x,y) in the plane
  • This topic builds your geometric intuition for everything that follows in the course

1. What is a Vector?

1.1 Intuition: The Displacement Arrow

Imagine you are standing at a street corner. You walk 3 steps east and then 4 steps north. Where do you end up? The "3 steps east, 4 steps north" is a vector โ€” it carries magnitude (5 steps, as the crow flies) and direction (north-east). Every vector has two ingredients:
  • Magnitude (length) โ€” how far
  • Direction โ€” which way In mathematics we represent this idea in two equivalent ways:
  1. Geometric arrow โ€” a directed line segment from a starting point AA to an ending point BB, written ABโ†’\overrightarrow{AB}
  2. Algebraic nn-tuple โ€” an ordered list of numbers, e.g. (3,4)(3, 4) in the plane or (3,4,โˆ’2)(3, 4, -2) in 3D space The same vector can appear anywhere in space โ€” translating it does not change it. Only its length and orientation matter.

1.2 Formal Definition

Definition (Vector in Rn\mathbb{R}^n). A vector is an ordered nn-tuple of real numbers
>v=(v1,v2,โ€ฆ,vn)orv=[v1v2โ‹ฎvn]>> \mathbf{v} = (v_1, v_2, \dots, v_n) \quad \text{or} \quad \mathbf{v} = \begin{bmatrix} v_1 \\ v_2 \\ \vdots \\ v_n \end{bmatrix} >
where each viโˆˆRv_i \in \mathbb{R}. The set of all such nn-tuples is Rn\mathbb{R}^n. The first notation (row vector) and second (column vector) are both common. In this course we mostly use column vectors for matrix multiplication compatibility. Key symbols and terminology:
SymbolMeaningExample
v\mathbf{v}a vector (bold lowercase)v=(1,โˆ’2,5)\mathbf{v} = (1, -2, 5)
viv_ithe ii -th component (coordinate)v2=โˆ’2v_2 = -2
Rn\mathbb{R}^nnn -dimensional Euclidean spaceR2\mathbb{R}^2 = the plane
0\mathbf{0}the zero vector (0,0,โ€ฆ,0)(0,0,\dots,0)(0,0)(0,0) in R2\mathbb{R}^2

1.3 Geometric Representation

(Diagram) A vector v=(v1,v2)\mathbf{v} = (v_1, v_2) in R2\mathbb{R}^2 is drawn as an arrow from the origin to the point (v1,v2)(v_1, v_2). Its length (magnitude) is:
โˆฅvโˆฅ=v12+v22\|\mathbf{v}\| = \sqrt{v_1^2 + v_2^2}
For v=(3,4)\mathbf{v} = (3,4):
โˆฅvโˆฅ=32+42=9+16=25=5\|\mathbf{v}\| = \sqrt{3^2 + 4^2} = \sqrt{9 + 16} = \sqrt{25} = 5
In R3\mathbb{R}^3, v=(v1,v2,v3)\mathbf{v} = (v_1, v_2, v_3) has length v12+v22+v32\sqrt{v_1^2 + v_2^2 + v_3^2}.

2. Vector Operations

2.1 Scalar Multiplication

Multiplying a vector v\mathbf{v} by a scalar (real number) cc changes its length but not its direction (unless cc is negative, which also flips the direction).
cv=(cv1,cv2,โ€ฆ,cvn)c\mathbf{v} = (c v_1, c v_2, \dots, c v_n)
Geometric effect:
  • c>1c > 1: stretches the arrow
  • 0<c<10 < c < 1: shrinks the arrow
  • c=0c = 0: collapses to the zero vector
  • c<0c < 0: flips the arrow to point opposite (and stretches/shrinks by โˆฃcโˆฃ|c|)
Example 1: Scalar multiplication
Let v=(2,โˆ’1,3)\mathbf{v} = (2, -1, 3).
>2v=(4,โˆ’2,6),12v=(1,โˆ’12,32),โˆ’3v=(โˆ’6,3,โˆ’9)>> 2\mathbf{v} = (4, -2, 6), \qquad \frac{1}{2}\mathbf{v} = \left(1, -\frac{1}{2}, \frac{3}{2}\right), \qquad -3\mathbf{v} = (-6, 3, -9) >

2.2 Vector Addition (and Subtraction)

Add two vectors component-wise:
v+w=(v1+w1,v2+w2,โ€ฆ,vn+wn)\mathbf{v} + \mathbf{w} = (v_1 + w_1, v_2 + w_2, \dots, v_n + w_n)
Geometric intuition: place the tail of w\mathbf{w} at the head of v\mathbf{v}; the sum is the arrow from the tail of v\mathbf{v} to the head of w\mathbf{w} (the tip-to-tail rule). (Diagram)
Example 2: Vector addition
v=(1,2,โˆ’1)\mathbf{v} = (1, 2, -1), w=(3,โˆ’1,4)\mathbf{w} = (3, -1, 4)
>v+w=(1+3,โ€…โ€Š2+(โˆ’1),โ€…โ€Šโˆ’1+4)=(4,1,3)>> \mathbf{v} + \mathbf{w} = (1+3,\; 2+(-1),\; -1+4) = (4, 1, 3) >
Subtraction: vโˆ’w=v+(โˆ’w)=(1โˆ’3,โ€…โ€Š2โˆ’(โˆ’1),โ€…โ€Šโˆ’1โˆ’4)=(โˆ’2,3,โˆ’5)\mathbf{v} - \mathbf{w} = \mathbf{v} + (-\mathbf{w}) = (1-3,\; 2-(-1),\; -1-4) = (-2, 3, -5)

2.3 Properties of Vector Operations

These properties hold for all vectors u,v,wโˆˆRn\mathbf{u}, \mathbf{v}, \mathbf{w} \in \mathbb{R}^n and scalars a,bโˆˆRa, b \in \mathbb{R}:
PropertyAdditionScalar Multiplication
Commutativityu+v=v+u\mathbf{u} + \mathbf{v} = \mathbf{v} + \mathbf{u}โ€”
Associativity(u+v)+w=u+(v+w)(\mathbf{u} + \mathbf{v}) + \mathbf{w} = \mathbf{u} + (\mathbf{v} + \mathbf{w})(ab)v=a(bv)(ab)\mathbf{v} = a(b\mathbf{v})
Identityv+0=v\mathbf{v} + \mathbf{0} = \mathbf{v}1v=v1\mathbf{v} = \mathbf{v}
Inversev+(โˆ’v)=0\mathbf{v} + (-\mathbf{v}) = \mathbf{0}โ€”
Distributive(a+b)v=av+bv(a+b)\mathbf{v} = a\mathbf{v} + b\mathbf{v}a(u+v)=au+ava(\mathbf{u}+\mathbf{v}) = a\mathbf{u} + a\mathbf{v}
These eight rules form the axioms of a vector space โ€” we will meet them again in Week 3.

3. Dot Product (Inner Product)

3.1 Intuition: How Much Do Two Vectors Align?

The dot product measures alignment. Two vectors pointing in roughly the same direction have a positive dot product; opposite directions give a negative dot product; perpendicular vectors give zero.

3.2 Definition

Definition (Dot Product). For u=(u1,โ€ฆ,un)\mathbf{u} = (u_1, \dots, u_n) and v=(v1,โ€ฆ,vn)\mathbf{v} = (v_1, \dots, v_n) in Rn\mathbb{R}^n,
>uโ‹…v=u1v1+u2v2+โ‹ฏ+unvn=โˆ‘i=1nuivi>> \mathbf{u} \cdot \mathbf{v} = u_1 v_1 + u_2 v_2 + \cdots + u_n v_n = \sum_{i=1}^n u_i v_i >
The result is a scalar (a real number), not a vector.

3.3 Relationship to Magnitude

The dot product of a vector with itself gives the squared length:
vโ‹…v=โˆฅvโˆฅ2\mathbf{v} \cdot \mathbf{v} = \|\mathbf{v}\|^2
Example 3: Dot product
u=(2,โˆ’1,3)\mathbf{u} = (2, -1, 3), v=(1,4,โˆ’2)\mathbf{v} = (1, 4, -2)
>uโ‹…v=2(1)+(โˆ’1)(4)+3(โˆ’2)=2โˆ’4โˆ’6=โˆ’8>> \begin{aligned} \mathbf{u} \cdot \mathbf{v} &= 2(1) + (-1)(4) + 3(-2) \\ &= 2 - 4 - 6 = -8 \end{aligned} >
โˆฅuโˆฅ=22+(โˆ’1)2+32=4+1+9=14\|\mathbf{u}\| = \sqrt{2^2 + (-1)^2 + 3^2} = \sqrt{4+1+9} = \sqrt{14}
Check: uโ‹…u=4+1+9=14=(14)2\mathbf{u} \cdot \mathbf{u} = 4 + 1 + 9 = 14 = (\sqrt{14})^2 โœ“

3.4 Geometric Formula and the Angle Between Vectors

The dot product relates to the angle ฮธ\theta between two vectors:
uโ‹…v=โˆฅuโˆฅโˆฅvโˆฅcosโกฮธ\mathbf{u} \cdot \mathbf{v} = \|\mathbf{u}\| \|\mathbf{v}\| \cos\theta
Therefore:
cosโกฮธ=uโ‹…vโˆฅuโˆฅโˆฅvโˆฅ,0โ‰คฮธโ‰คฯ€\cos\theta = \frac{\mathbf{u} \cdot \mathbf{v}}{\|\mathbf{u}\| \|\mathbf{v}\|}, \quad 0 \leq \theta \leq \pi
Example 4: Angle between two vectors
Find the angle between u=(1,0,1)\mathbf{u} = (1, 0, 1) and v=(0,1,1)\mathbf{v} = (0, 1, 1).
>uโ‹…v=1(0)+0(1)+1(1)=1โˆฅuโˆฅ=1+0+1=2โˆฅvโˆฅ=0+1+1=2cosโกฮธ=122=12ฮธ=cosโกโˆ’1(12)=ฯ€3=60โˆ˜>> \begin{aligned} \mathbf{u} \cdot \mathbf{v} &= 1(0) + 0(1) + 1(1) = 1 \\ \|\mathbf{u}\| &= \sqrt{1+0+1} = \sqrt{2} \\ \|\mathbf{v}\| &= \sqrt{0+1+1} = \sqrt{2} \\ \cos\theta &= \frac{1}{\sqrt{2}\sqrt{2}} = \frac{1}{2} \\ \theta &= \cos^{-1}\left(\frac{1}{2}\right) = \frac{\pi}{3} = 60^\circ \end{aligned} >

3.5 Orthogonal (Perpendicular) Vectors

Two vectors are orthogonal (perpendicular) when uโ‹…v=0\mathbf{u} \cdot \mathbf{v} = 0. This is because cosโก(90โˆ˜)=0\cos(90^\circ) = 0, so uโ‹…v=โˆฅuโˆฅโˆฅvโˆฅโ‹…0=0\mathbf{u} \cdot \mathbf{v} = \|\mathbf{u}\| \|\mathbf{v}\| \cdot 0 = 0.
Example 5: Orthogonal vectors
u=(1,2,โˆ’3)\mathbf{u} = (1, 2, -3), v=(4,1,2)\mathbf{v} = (4, 1, 2)
uโ‹…v=1(4)+2(1)+(โˆ’3)(2)=4+2โˆ’6=0\mathbf{u} \cdot \mathbf{v} = 1(4) + 2(1) + (-3)(2) = 4 + 2 - 6 = 0 โœ“
Therefore uโŠฅv\mathbf{u} \perp \mathbf{v}.

3.6 Properties of the Dot Product

PropertyFormula
Commutativityuโ‹…v=vโ‹…u\mathbf{u} \cdot \mathbf{v} = \mathbf{v} \cdot \mathbf{u}
Linearityuโ‹…(av+bw)=a(uโ‹…v)+b(uโ‹…w)\mathbf{u} \cdot (a\mathbf{v} + b\mathbf{w}) = a(\mathbf{u} \cdot \mathbf{v}) + b(\mathbf{u} \cdot \mathbf{w})
Positive definitenessvโ‹…vโ‰ฅ0\mathbf{v} \cdot \mathbf{v} \geq 0 , and =0=0 only when v=0\mathbf{v} = \mathbf{0}
Cauchy-Schwarz$

4. Cross Product (in โ„ยณ)

4.1 Intuition: The Perpendicular Area Vector

While the dot product tells us how much two vectors align, the cross product produces a third vector perpendicular to both. Its magnitude equals the area of the parallelogram spanned by the two input vectors.

4.2 Definition

Definition (Cross Product). For u=(u1,u2,u3)\mathbf{u} = (u_1, u_2, u_3) and v=(v1,v2,v3)\mathbf{v} = (v_1, v_2, v_3) in R3\mathbb{R}^3,
>uร—v=(u2v3โˆ’u3v2,โ€…โ€Šu3v1โˆ’u1v3,โ€…โ€Šu1v2โˆ’u2v1)>> \mathbf{u} \times \mathbf{v} = (u_2 v_3 - u_3 v_2,\; u_3 v_1 - u_1 v_3,\; u_1 v_2 - u_2 v_1) >
The result is a vector in R3\mathbb{R}^3 (unlike the dot product). A handy mnemonic using a determinant:
uร—v=โˆฃijku1u2u3v1v2v3โˆฃ\mathbf{u} \times \mathbf{v} = \begin{vmatrix} \mathbf{i} & \mathbf{j} & \mathbf{k} \\ u_1 & u_2 & u_3 \\ v_1 & v_2 & v_3 \end{vmatrix}
where i,j,k\mathbf{i}, \mathbf{j}, \mathbf{k} are the standard basis vectors (1,0,0)(1,0,0), (0,1,0)(0,1,0), (0,0,1)(0,0,1).

4.3 Geometric Interpretation

  • Direction: uร—v\mathbf{u} \times \mathbf{v} is perpendicular to both u\mathbf{u} and v\mathbf{v} (right-hand rule)
  • Magnitude: โˆฅuร—vโˆฅ=โˆฅuโˆฅโˆฅvโˆฅsinโกฮธ\|\mathbf{u} \times \mathbf{v}\| = \|\mathbf{u}\| \|\mathbf{v}\| \sin\theta = area of parallelogram (Diagram)
Example 6: Cross product
u=(1,2,3)\mathbf{u} = (1, 2, 3), v=(4,5,6)\mathbf{v} = (4, 5, 6)
>uร—v=(2โ‹…6โˆ’3โ‹…5,โ€…โ€Š3โ‹…4โˆ’1โ‹…6,โ€…โ€Š1โ‹…5โˆ’2โ‹…4)=(12โˆ’15,โ€…โ€Š12โˆ’6,โ€…โ€Š5โˆ’8)=(โˆ’3,6,โˆ’3)>> \begin{aligned} \mathbf{u} \times \mathbf{v} &= (2\cdot6 - 3\cdot5,\; 3\cdot4 - 1\cdot6,\; 1\cdot5 - 2\cdot4) \\ &= (12 - 15,\; 12 - 6,\; 5 - 8) \\ &= (-3, 6, -3) \end{aligned} >
Check orthogonality: uโ‹…(uร—v)=1(โˆ’3)+2(6)+3(โˆ’3)=โˆ’3+12โˆ’9=0\mathbf{u} \cdot (\mathbf{u} \times \mathbf{v}) = 1(-3) + 2(6) + 3(-3) = -3 + 12 - 9 = 0 โœ“
vโ‹…(uร—v)=4(โˆ’3)+5(6)+6(โˆ’3)=โˆ’12+30โˆ’18=0\mathbf{v} \cdot (\mathbf{u} \times \mathbf{v}) = 4(-3) + 5(6) + 6(-3) = -12 + 30 - 18 = 0 โœ“

4.4 Properties of Cross Product

PropertyFormula
Anti-commutativityuร—v=โˆ’(vร—u)\mathbf{u} \times \mathbf{v} = -(\mathbf{v} \times \mathbf{u})
Linearityuร—(av+bw)=a(uร—v)+b(uร—w)\mathbf{u} \times (a\mathbf{v} + b\mathbf{w}) = a(\mathbf{u} \times \mathbf{v}) + b(\mathbf{u} \times \mathbf{w})
Scalar triple productuโ‹…(vร—w)=detโก[uโ€…โ€Švโ€…โ€Šw]\mathbf{u} \cdot (\mathbf{v} \times \mathbf{w}) = \det[\mathbf{u}\; \mathbf{v}\; \mathbf{w}] (volume)
Self crossvร—v=0\mathbf{v} \times \mathbf{v} = \mathbf{0}

5. Vector Projection

5.1 Intuition: How Much of v Points in the Direction of u?

Projection decomposes a vector v\mathbf{v} into two parts: one parallel to u\mathbf{u} and one perpendicular to u\mathbf{u}.

5.2 Formula

The scalar projection (component) of v\mathbf{v} onto u\mathbf{u} is:
compuv=vโ‹…uโˆฅuโˆฅ\text{comp}_{\mathbf{u}} \mathbf{v} = \frac{\mathbf{v} \cdot \mathbf{u}}{\|\mathbf{u}\|}
The vector projection of v\mathbf{v} onto u\mathbf{u} is:
projuv=vโ‹…uโˆฅuโˆฅ2u\text{proj}_{\mathbf{u}} \mathbf{v} = \frac{\mathbf{v} \cdot \mathbf{u}}{\|\mathbf{u}\|^2} \mathbf{u}
The perpendicular component is:
vโŠฅ=vโˆ’projuv\mathbf{v}_{\perp} = \mathbf{v} - \text{proj}_{\mathbf{u}} \mathbf{v}
Example 7: Projection
Find the projection of v=(3,1,โˆ’2)\mathbf{v} = (3, 1, -2) onto u=(1,2,2)\mathbf{u} = (1, 2, 2).
>vโ‹…u=3(1)+1(2)+(โˆ’2)(2)=3+2โˆ’4=1โˆฅuโˆฅ2=12+22+22=1+4+4=9projuv=19(1,2,2)=(19,29,29)vโŠฅ=(3,1,โˆ’2)โˆ’(19,29,29)=(269,79,โˆ’209)>> \begin{aligned} \mathbf{v} \cdot \mathbf{u} &= 3(1) + 1(2) + (-2)(2) = 3 + 2 - 4 = 1 \\ \|\mathbf{u}\|^2 &= 1^2 + 2^2 + 2^2 = 1 + 4 + 4 = 9 \\ \text{proj}_{\mathbf{u}} \mathbf{v} &= \frac{1}{9}(1, 2, 2) = \left(\frac{1}{9}, \frac{2}{9}, \frac{2}{9}\right) \\ \mathbf{v}_{\perp} &= (3, 1, -2) - \left(\frac{1}{9}, \frac{2}{9}, \frac{2}{9}\right) = \left(\frac{26}{9}, \frac{7}{9}, -\frac{20}{9}\right) \end{aligned} >

6. Edge Cases & Gotchas

SituationWhat HappensWhy It Matters
**Zero vector 0\mathbf{0} **Has no direction, length 0Dot product with anything is 0; cross product with anything is 0\mathbf{0}
Division by zero in angle formulaIf $\\mathbf{u}\
**Cross product only in R3\mathbb{R}^3 **The 3D cross product does not exist in R2\mathbb{R}^2 or Rn\mathbb{R}^n for nโ‰ 3n \neq 3In R2\mathbb{R}^2 , use the determinant or the "perp dot product" u1v2โˆ’u2v1u_1 v_2 - u_2 v_1
Vectors vs. pointsA vector is a displacement, not a locationThe same vector can be drawn anchored anywhere

7. Common Pitfalls

โŒ Pitfall 1: Adding vectors of different dimensions

You cannot add (1,2,3)+(4,5)(1,2,3) + (4,5) โ€” dimensions must match.

โŒ Pitfall 2: Dot product produces a scalar

uโ‹…v\mathbf{u} \cdot \mathbf{v} is a number, not a vector. A common mistake is writing uโ‹…v=(u1v1,u2v2,โ€ฆโ€‰)\mathbf{u} \cdot \mathbf{v} = (u_1 v_1, u_2 v_2, \dots) โ€” that is the Hadamard (element-wise) product, not the dot product.

โŒ Pitfall 3: Confusing projection formulas

Scalar projection: vโ‹…uโˆฅuโˆฅ\frac{\mathbf{v} \cdot \mathbf{u}}{\|\mathbf{u}\|} (a scalar). Vector projection: vโ‹…uโˆฅuโˆฅ2u\frac{\mathbf{v} \cdot \mathbf{u}}{\|\mathbf{u}\|^2} \mathbf{u} (a vector). The difference is dividing by โˆฅuโˆฅ\|\mathbf{u}\| vs. โˆฅuโˆฅ2\|\mathbf{u}\|^2.

8. Formula Summary Table

ConceptFormulaNotes
Magnitude$\\mathbf{v}\
Dot productuโ‹…v=โˆ‘uivi\mathbf{u} \cdot \mathbf{v} = \sum u_i v_iResult is a scalar
Angle$\cos\theta = \frac{\mathbf{u} \cdot \mathbf{v}}{\\mathbf{u}\
Orthogonalityuโ‹…v=0\mathbf{u} \cdot \mathbf{v} = 0Perpendicular vectors
Cross product (โ„ยณ)uร—v=(u2v3โˆ’u3v2,โ€ฆโ€‰)\mathbf{u} \times \mathbf{v} = (u_2 v_3 - u_3 v_2, \dots)Result is a vector
Projection$\text{proj}_{\mathbf{u}} \mathbf{v} = \frac{\mathbf{v} \cdot \mathbf{u}}{\\mathbf{u}\
Cauchy-Schwarz$\mathbf{u} \cdot \mathbf{v}

9. ๐Ÿ“ Practice Questions

Q1: Basic operations
Let u=(2,โˆ’1,3)\mathbf{u} = (2, -1, 3) and v=(0,4,โˆ’2)\mathbf{v} = (0, 4, -2). Compute: (a) 2uโˆ’3v2\mathbf{u} - 3\mathbf{v} (b) uโ‹…v\mathbf{u} \cdot \mathbf{v} (c) uร—v\mathbf{u} \times \mathbf{v}
Strategy: Work component-wise for (a), use sum of products for (b), use determinant formula for (c).
Solution (a):
>2u=(4,โˆ’2,6),3v=(0,12,โˆ’6)>> 2\mathbf{u} = (4, -2, 6), \quad 3\mathbf{v} = (0, 12, -6) >
>2uโˆ’3v=(4โˆ’0,โˆ’2โˆ’12,6โˆ’(โˆ’6))=(4,โˆ’14,12)>> 2\mathbf{u} - 3\mathbf{v} = (4 - 0, -2 - 12, 6 - (-6)) = (4, -14, 12) >
Solution (b):
>uโ‹…v=2(0)+(โˆ’1)(4)+3(โˆ’2)=0โˆ’4โˆ’6=โˆ’10>> \mathbf{u} \cdot \mathbf{v} = 2(0) + (-1)(4) + 3(-2) = 0 - 4 - 6 = -10 >
Solution (c):
>uร—v=((โˆ’1)(โˆ’2)โˆ’3(4),โ€…โ€Š3(0)โˆ’2(โˆ’2),โ€…โ€Š2(4)โˆ’(โˆ’1)(0))=(2โˆ’12,โ€…โ€Š0+4,โ€…โ€Š8โˆ’0)=(โˆ’10,4,8)>> \begin{aligned} \mathbf{u} \times \mathbf{v} &= ((-1)(-2) - 3(4),\; 3(0) - 2(-2),\; 2(4) - (-1)(0)) \\ &= (2 - 12,\; 0 + 4,\; 8 - 0) \\ &= (-10, 4, 8) \end{aligned} >
Q2: Angle between vectors
Find the angle between u=(1,1,1)\mathbf{u} = (1, 1, 1) and v=(1,0,2)\mathbf{v} = (1, 0, 2).
Strategy: Use cosโกฮธ=uโ‹…vโˆฅuโˆฅโˆฅvโˆฅ\cos\theta = \frac{\mathbf{u} \cdot \mathbf{v}}{\|\mathbf{u}\| \|\mathbf{v}\|}.
Solution:
>uโ‹…v=1(1)+1(0)+1(2)=3>> \mathbf{u} \cdot \mathbf{v} = 1(1) + 1(0) + 1(2) = 3 >
>โˆฅuโˆฅ=1+1+1=3,โˆฅvโˆฅ=1+0+4=5>> \|\mathbf{u}\| = \sqrt{1+1+1} = \sqrt{3}, \quad \|\mathbf{v}\| = \sqrt{1+0+4} = \sqrt{5} >
>cosโกฮธ=335=315โ‰ˆ0.7746>> \cos\theta = \frac{3}{\sqrt{3}\sqrt{5}} = \frac{3}{\sqrt{15}} \approx 0.7746 >
>ฮธ=cosโกโˆ’1(315)โ‰ˆ39.2โˆ˜>> \theta = \cos^{-1}\left(\frac{3}{\sqrt{15}}\right) \approx 39.2^\circ >
Q3: Orthogonality test
Are u=(2,โˆ’1,4)\mathbf{u} = (2, -1, 4) and v=(3,2,โˆ’1)\mathbf{v} = (3, 2, -1) orthogonal?
Strategy: Compute dot product. If zero, they are orthogonal.
Solution:
>uโ‹…v=2(3)+(โˆ’1)(2)+4(โˆ’1)=6โˆ’2โˆ’4=0>> \mathbf{u} \cdot \mathbf{v} = 2(3) + (-1)(2) + 4(-1) = 6 - 2 - 4 = 0 >
Yes, they are orthogonal. Q4: Vector projection
Find the vector projection of v=(4,1,โˆ’2)\mathbf{v} = (4, 1, -2) onto u=(2,โˆ’1,3)\mathbf{u} = (2, -1, 3).
Strategy: Use projuv=vโ‹…uโˆฅuโˆฅ2u\text{proj}_{\mathbf{u}} \mathbf{v} = \frac{\mathbf{v} \cdot \mathbf{u}}{\|\mathbf{u}\|^2} \mathbf{u}.
Solution:
>vโ‹…u=4(2)+1(โˆ’1)+(โˆ’2)(3)=8โˆ’1โˆ’6=1>> \mathbf{v} \cdot \mathbf{u} = 4(2) + 1(-1) + (-2)(3) = 8 - 1 - 6 = 1 >
>โˆฅuโˆฅ2=4+1+9=14>> \|\mathbf{u}\|^2 = 4 + 1 + 9 = 14 >
>projuv=114(2,โˆ’1,3)=(17,โˆ’114,314)>> \text{proj}_{\mathbf{u}} \mathbf{v} = \frac{1}{14}(2, -1, 3) = \left(\frac{1}{7}, -\frac{1}{14}, \frac{3}{14}\right) >
Q5: Cross product area
Find the area of the parallelogram spanned by u=(1,0,2)\mathbf{u} = (1, 0, 2) and v=(0,3,1)\mathbf{v} = (0, 3, 1).
Strategy: Area = โˆฅuร—vโˆฅ\|\mathbf{u} \times \mathbf{v}\|.
Solution:
>uร—v=(0(1)โˆ’2(3),โ€…โ€Š2(0)โˆ’1(1),โ€…โ€Š1(3)โˆ’0(0))=(โˆ’6,โˆ’1,3)>> \mathbf{u} \times \mathbf{v} = (0(1) - 2(3),\; 2(0) - 1(1),\; 1(3) - 0(0)) = (-6, -1, 3) >
>Area=(โˆ’6)2+(โˆ’1)2+32=36+1+9=46>> \text{Area} = \sqrt{(-6)^2 + (-1)^2 + 3^2} = \sqrt{36 + 1 + 9} = \sqrt{46} >
Q6: Unit vector
Find a unit vector in the direction of v=(2,โˆ’2,1)\mathbf{v} = (2, -2, 1).
Strategy: Divide the vector by its magnitude.
Solution:
>โˆฅvโˆฅ=4+4+1=9=3>> \|\mathbf{v}\| = \sqrt{4 + 4 + 1} = \sqrt{9} = 3 >
>v^=vโˆฅvโˆฅ=(23,โˆ’23,13)>> \hat{\mathbf{v}} = \frac{\mathbf{v}}{\|\mathbf{v}\|} = \left(\frac{2}{3}, -\frac{2}{3}, \frac{1}{3}\right) >
Q7: Dot product properties
If u\mathbf{u} and v\mathbf{v} are unit vectors and uโ‹…v=12\mathbf{u} \cdot \mathbf{v} = \frac{1}{2}, find โˆฅuโˆ’vโˆฅ\|\mathbf{u} - \mathbf{v}\|.
Strategy: Use โˆฅuโˆ’vโˆฅ2=(uโˆ’v)โ‹…(uโˆ’v)=โˆฅuโˆฅ2+โˆฅvโˆฅ2โˆ’2uโ‹…v\|\mathbf{u} - \mathbf{v}\|^2 = (\mathbf{u} - \mathbf{v}) \cdot (\mathbf{u} - \mathbf{v}) = \|\mathbf{u}\|^2 + \|\mathbf{v}\|^2 - 2\mathbf{u} \cdot \mathbf{v}.
Solution:
>โˆฅuโˆ’vโˆฅ2=1+1โˆ’2(12)=2โˆ’1=1>> \|\mathbf{u} - \mathbf{v}\|^2 = 1 + 1 - 2\left(\frac{1}{2}\right) = 2 - 1 = 1 >
>โˆฅuโˆ’vโˆฅ=1>> \|\mathbf{u} - \mathbf{v}\| = 1 >
Q8: Finding a perpendicular vector
Find a vector w\mathbf{w} in R3\mathbb{R}^3 that is perpendicular to both u=(1,2,โˆ’1)\mathbf{u} = (1, 2, -1) and v=(3,0,4)\mathbf{v} = (3, 0, 4).
Strategy: Use the cross product w=uร—v\mathbf{w} = \mathbf{u} \times \mathbf{v}.
Solution:
>w=(2(4)โˆ’(โˆ’1)(0),โ€…โ€Š(โˆ’1)(3)โˆ’1(4),โ€…โ€Š1(0)โˆ’2(3))=(8โˆ’0,โ€…โ€Šโˆ’3โˆ’4,โ€…โ€Š0โˆ’6)=(8,โˆ’7,โˆ’6)>> \begin{aligned} \mathbf{w} &= (2(4) - (-1)(0),\; (-1)(3) - 1(4),\; 1(0) - 2(3)) \\ &= (8 - 0,\; -3 - 4,\; 0 - 6) \\ &= (8, -7, -6) \end{aligned} >
Check: uโ‹…w=1(8)+2(โˆ’7)+(โˆ’1)(โˆ’6)=8โˆ’14+6=0\mathbf{u} \cdot \mathbf{w} = 1(8) + 2(-7) + (-1)(-6) = 8 - 14 + 6 = 0 โœ“ Q9: Scalar triple product
Find the volume of the parallelepiped spanned by a=(1,0,0)\mathbf{a} = (1, 0, 0), b=(0,2,0)\mathbf{b} = (0, 2, 0), c=(1,1,3)\mathbf{c} = (1, 1, 3).
Strategy: Volume = โˆฃaโ‹…(bร—c)โˆฃ|\mathbf{a} \cdot (\mathbf{b} \times \mathbf{c})|.
Solution:
>bร—c=(2(3)โˆ’0(1),โ€…โ€Š0(1)โˆ’0(3),โ€…โ€Š0(1)โˆ’2(1))=(6,0,โˆ’2)>> \mathbf{b} \times \mathbf{c} = (2(3) - 0(1),\; 0(1) - 0(3),\; 0(1) - 2(1)) = (6, 0, -2) >
>aโ‹…(bร—c)=1(6)+0(0)+0(โˆ’2)=6>> \mathbf{a} \cdot (\mathbf{b} \times \mathbf{c}) = 1(6) + 0(0) + 0(-2) = 6 >
>Volume=โˆฃ6โˆฃ=6>> \text{Volume} = |6| = 6 >
Q10: Decomposition
Decompose v=(5,2,1)\mathbf{v} = (5, 2, 1) into components parallel and perpendicular to u=(1,1,1)\mathbf{u} = (1, 1, 1).
Strategy: Compute vโˆฅ=projuv\mathbf{v}_\parallel = \text{proj}_{\mathbf{u}} \mathbf{v}, then vโŠฅ=vโˆ’vโˆฅ\mathbf{v}_\perp = \mathbf{v} - \mathbf{v}_\parallel.
Solution:
>vโ‹…u=5+2+1=8,โˆฅuโˆฅ2=3>> \mathbf{v} \cdot \mathbf{u} = 5 + 2 + 1 = 8, \quad \|\mathbf{u}\|^2 = 3 >
>vโˆฅ=83(1,1,1)=(83,83,83)>> \mathbf{v}_\parallel = \frac{8}{3}(1, 1, 1) = \left(\frac{8}{3}, \frac{8}{3}, \frac{8}{3}\right) >
>vโŠฅ=(5โˆ’83,โ€…โ€Š2โˆ’83,โ€…โ€Š1โˆ’83)=(73,โˆ’23,โˆ’53)>> \mathbf{v}_\perp = \left(5 - \frac{8}{3},\; 2 - \frac{8}{3},\; 1 - \frac{8}{3}\right) = \left(\frac{7}{3}, -\frac{2}{3}, -\frac{5}{3}\right) >
Check: vโˆฅโ‹…vโŠฅ=83โ‹…73+83โ‹…(โˆ’23)+83โ‹…(โˆ’53)=56โˆ’16โˆ’409=0\mathbf{v}_\parallel \cdot \mathbf{v}_\perp = \frac{8}{3}\cdot\frac{7}{3} + \frac{8}{3}\cdot\left(-\frac{2}{3}\right) + \frac{8}{3}\cdot\left(-\frac{5}{3}\right) = \frac{56-16-40}{9} = 0 โœ“

๐Ÿ”— Cross-References

  • Next topic: Matrices Introduction โ€” matrices as arrays of vectors
  • BSMA1001 (Maths 1): Review coordinate geometry and basic algebra
  • Week 7 (Inner Products): Generalises the dot product to abstract vector spaces
  • Week 3 (Vector Spaces): The eight axioms formalise what we've seen here
  • BSCS2004 (ML Foundations): Vectors are the data representation in ML Join Discord Next1.2 Matrices Introduction
Document outline

Keep your place and jump directly to a heading.

Table of contents

No note selected

Open a chapter to see its outline, backlinks, and sources here.