Quiz 2

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=[v1v2vn]>> \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 viRv_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: vw=v+(w)=(13,  2(1),  14)=(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,wRn\mathbf{u}, \mathbf{v}, \mathbf{w} \in \mathbb{R}^n and scalars a,bRa, 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,
>uv=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:
vv=v2\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)
>uv=2(1)+(1)(4)+3(2)=246=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: uu=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:
uv=uvcosθ\mathbf{u} \cdot \mathbf{v} = \|\mathbf{u}\| \|\mathbf{v}\| \cos\theta
Therefore:
cosθ=uvuv,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).
>uv=1(0)+0(1)+1(1)=1u=1+0+1=2v=0+1+1=2cosθ=122=12θ=cos1(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 uv=0\mathbf{u} \cdot \mathbf{v} = 0. This is because cos(90)=0\cos(90^\circ) = 0, so uv=uv0=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)
uv=1(4)+2(1)+(3)(2)=4+26=0\mathbf{u} \cdot \mathbf{v} = 1(4) + 2(1) + (-3)(2) = 4 + 2 - 6 = 0
Therefore uv\mathbf{u} \perp \mathbf{v}.

3.6 Properties of the Dot Product

PropertyFormula
Commutativityuv=vu\mathbf{u} \cdot \mathbf{v} = \mathbf{v} \cdot \mathbf{u}
Linearityu(av+bw)=a(uv)+b(uw)\mathbf{u} \cdot (a\mathbf{v} + b\mathbf{w}) = a(\mathbf{u} \cdot \mathbf{v}) + b(\mathbf{u} \cdot \mathbf{w})
Positive definitenessvv0\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=(u2v3u3v2,  u3v1u1v3,  u1v2u2v1)>> \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=uvsinθ\|\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=(2635,  3416,  1524)=(1215,  126,  58)=(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+129=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+3018=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=vuu\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=vuu2u\text{proj}_{\mathbf{u}} \mathbf{v} = \frac{\mathbf{v} \cdot \mathbf{u}}{\|\mathbf{u}\|^2} \mathbf{u}
The perpendicular component is:
v=vprojuv\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).
>vu=3(1)+1(2)+(2)(2)=3+24=1u2=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 n3n \neq 3In R2\mathbb{R}^2 , use the determinant or the "perp dot product" u1v2u2v1u_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

uv\mathbf{u} \cdot \mathbf{v} is a number, not a vector. A common mistake is writing uv=(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: vuu\frac{\mathbf{v} \cdot \mathbf{u}}{\|\mathbf{u}\|} (a scalar). Vector projection: vuu2u\frac{\mathbf{v} \cdot \mathbf{u}}{\|\mathbf{u}\|^2} \mathbf{u} (a vector). The difference is dividing by u\|\mathbf{u}\| vs. u2\|\mathbf{u}\|^2.

8. Formula Summary Table

ConceptFormulaNotes
Magnitude$\\mathbf{v}\
Dot productuv=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}\
Orthogonalityuv=0\mathbf{u} \cdot \mathbf{v} = 0Perpendicular vectors
Cross product (ℝ³)u×v=(u2v3u3v2,)\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) 2u3v2\mathbf{u} - 3\mathbf{v} (b) uv\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) >
>2u3v=(40,212,6(6))=(4,14,12)>> 2\mathbf{u} - 3\mathbf{v} = (4 - 0, -2 - 12, 6 - (-6)) = (4, -14, 12) >
Solution (b):
>uv=2(0)+(1)(4)+3(2)=046=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))=(212,  0+4,  80)=(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θ=uvuv\cos\theta = \frac{\mathbf{u} \cdot \mathbf{v}}{\|\mathbf{u}\| \|\mathbf{v}\|}.
Solution:
>uv=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=3150.7746>> \cos\theta = \frac{3}{\sqrt{3}\sqrt{5}} = \frac{3}{\sqrt{15}} \approx 0.7746 >
>θ=cos1(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:
>uv=2(3)+(1)(2)+4(1)=624=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=vuu2u\text{proj}_{\mathbf{u}} \mathbf{v} = \frac{\mathbf{v} \cdot \mathbf{u}}{\|\mathbf{u}\|^2} \mathbf{u}.
Solution:
>vu=4(2)+1(1)+(2)(3)=816=1>> \mathbf{v} \cdot \mathbf{u} = 4(2) + 1(-1) + (-2)(3) = 8 - 1 - 6 = 1 >
>u2=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^=vv=(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 uv=12\mathbf{u} \cdot \mathbf{v} = \frac{1}{2}, find uv\|\mathbf{u} - \mathbf{v}\|.
Strategy: Use uv2=(uv)(uv)=u2+v22uv\|\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:
>uv2=1+12(12)=21=1>> \|\mathbf{u} - \mathbf{v}\|^2 = 1 + 1 - 2\left(\frac{1}{2}\right) = 2 - 1 = 1 >
>uv=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))=(80,  34,  06)=(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: uw=1(8)+2(7)+(1)(6)=814+6=0\mathbf{u} \cdot \mathbf{w} = 1(8) + 2(-7) + (-1)(-6) = 8 - 14 + 6 = 0Q9: 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=vv\mathbf{v}_\perp = \mathbf{v} - \mathbf{v}_\parallel.
Solution:
>vu=5+2+1=8,u2=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=(583,  283,  183)=(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: vv=8373+83(23)+83(53)=5616409=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
System Normal // Awaiting Context

Intelligence Hub

Navigate the knowledge graph to generate context. The Hub adapts dynamically to surface backlinks, related notes, and metadata insights.