4.5.1Linear Algebra (Full)

Vectors in ℝⁿ — operations, geometric interpretation

1,809 words8 min readdifficulty · medium5 backlinks

WHAT is a vector in ℝⁿ?

WHY two pictures?

  • As a point: the tuple is an address in space.
  • As an arrow: it is the displacement from the origin 0\mathbf{0} to that point. The arrow picture is what lets us add and scale; the point picture is what lets us locate.

The two fundamental operations

Everything else is built from exactly two operations.


Building length from first principles (the norm)

Derivation (in R2\mathbb{R}^2 then generalize): In R2\mathbb{R}^2, v=(v1,v2)\mathbf v=(v_1,v_2) is the hypotenuse of a right triangle with legs v1v_1 and v2v_2. By Pythagoras: v2=v12+v22\|\mathbf v\|^2 = v_1^2 + v_2^2.

In R3\mathbb{R}^3, drop to the xyxy-plane: that diagonal has squared length v12+v22v_1^2+v_2^2, and it is perpendicular to the zz-leg v3v_3. Apply Pythagoras again: v2=(v12+v22)+v32.\|\mathbf v\|^2 = (v_1^2+v_2^2) + v_3^2. Repeating this "one new perpendicular axis at a time" nn times gives:

A vector with v=1\|\mathbf v\|=1 is a unit vector. To make any nonzero v\mathbf v into one, normalize: v^=vv\hat{\mathbf v} = \dfrac{\mathbf v}{\|\mathbf v\|} (same direction, length 1).


The dot product — where geometry meets algebra

WHY does this single number encode the angle between arrows? Derive it from the Law of Cosines. Consider the triangle formed by u\mathbf u, v\mathbf v, and the side uv\mathbf u-\mathbf v: uv2=u2+v22uvcosθ.\|\mathbf u - \mathbf v\|^2 = \|\mathbf u\|^2 + \|\mathbf v\|^2 - 2\|\mathbf u\|\|\mathbf v\|\cos\theta. Now expand the left side using w2=ww\|\mathbf w\|^2 = \mathbf w\cdot\mathbf w and bilinearity:

= \|\mathbf u\|^2 - 2\,\mathbf u\cdot\mathbf v + \|\mathbf v\|^2.$$ Set the two expressions equal; the $\|\mathbf u\|^2$ and $\|\mathbf v\|^2$ cancel: $$-2\,\mathbf u\cdot\mathbf v = -2\|\mathbf u\|\|\mathbf v\|\cos\theta.$$ > [!formula] Geometric meaning of the dot product > $$\boxed{\;\mathbf u\cdot\mathbf v = \|\mathbf u\|\,\|\mathbf v\|\cos\theta\;}$$ > Hence $\cos\theta = \dfrac{\mathbf u\cdot\mathbf v}{\|\mathbf u\|\|\mathbf v\|}$, and crucially: > $$\mathbf u \perp \mathbf v \iff \mathbf u\cdot\mathbf v = 0.$$ ![[4.5.01-Vectors-in-Rn-—-operations,-geometric-interpretation.png]] --- ## Worked examples > [!example] 1 — Addition & scaling > Let $\mathbf u=(1,2)$, $\mathbf v=(3,-1)$. Find $2\mathbf u - \mathbf v$. > - $2\mathbf u = (2,4)$ — *Why?* scalar mult is component-wise. > - $2\mathbf u - \mathbf v = (2-3,\;4-(-1)) = (-1,5)$ — *Why?* subtraction = add $(-1)\mathbf v$, component-wise. > [!example] 2 — Length & unit vector > $\mathbf w=(3,4)$. Then $\|\mathbf w\|=\sqrt{3^2+4^2}=\sqrt{25}=5$. > - *Why?* Pythagoras: it's the hypotenuse of a 3–4 triangle. > - Unit vector: $\hat{\mathbf w}=\frac15(3,4)=(0.6,0.8)$. *Why divide by 5?* dividing by the length > rescales to length exactly 1 without rotating. > [!example] 3 — Angle between vectors > $\mathbf a=(1,0,1)$, $\mathbf b=(0,1,1)$. > - $\mathbf a\cdot\mathbf b = 1\cdot0+0\cdot1+1\cdot1 = 1$ — *Why?* sum of products of matching components. > - $\|\mathbf a\|=\|\mathbf b\|=\sqrt2$ — *Why?* $\sqrt{1+0+1}$. > - $\cos\theta = \dfrac{1}{\sqrt2\cdot\sqrt2}=\tfrac12 \Rightarrow \theta=60^\circ$. > *Why?* plug into the boxed formula; $\arccos\frac12=60^\circ$. > [!example] 4 — Forecast-then-Verify > **Forecast:** are $(2,-3)$ and $(3,2)$ perpendicular? *Guess first!* > **Verify:** $2\cdot3 + (-3)\cdot2 = 6-6 = 0$. Yes — dot product zero $\Rightarrow$ perpendicular. ✓ --- ## Common mistakes (Steel-manned) > [!mistake] "Vectors multiply component-wise like they add." > **Why it feels right:** addition is component-wise, so by symmetry multiplication should be too, > giving $(u_1v_1,\dots)$. **The fix:** that "product" isn't useful geometrically. The meaningful > products are the **dot product** (gives a *scalar*, encodes angle) and the cross product (only in > $\mathbb{R}^3$). Component-wise product carries no geometric meaning here. > [!mistake] "The dot product gives another vector." > **Why it feels right:** every other operation so far ($+$, scaling) returns a vector. > **The fix:** $\mathbf u\cdot\mathbf v$ is a **single number (scalar)** — it *measures* alignment, > it doesn't point anywhere. If you got a vector, you computed the wrong thing. > [!mistake] "Normalizing means subtracting the mean / making length 0." > **Why it feels right:** "normalize" sounds like statistics. **The fix:** here normalize = > *divide by the norm* so length becomes $1$. Direction is preserved. --- > [!recall]- Feynman: explain to a 12-year-old > Imagine a treasure map. A vector is an instruction like "go 3 steps right and 4 steps up." > To **add** two instructions, you just follow one then the other — and you can do the right-steps > and up-steps separately. The **length** is how far you actually walked in a straight line from > start to finish (3-right + 4-up = 5 steps straight, the classic triangle!). The **dot product** > is a cleverness meter: if two instructions point the same way, it's big; if they cross at a right > angle, it's exactly zero. That zero is how a computer "knows" two directions are perpendicular. > [!mnemonic] Remember the operations > **"Add Across, Scale All, Length is the Long way (Pythagoras), Dot is Direction."** > And for the dot: **"Dot = product, Cross-axis = 0"** → matching components multiply, perpendicular ⇒ 0. --- ## Active-recall flashcards #flashcards/maths What is a vector in ℝⁿ? ::: An ordered $n$-tuple $(v_1,\dots,v_n)$ of real numbers; geometrically a point or an arrow from the origin. How do you add two vectors in ℝⁿ? ::: Component-wise: $(u_i+v_i)$ for each $i$; geometrically tip-to-tail / parallelogram rule. Define the Euclidean norm. ::: $\|\mathbf v\|=\sqrt{\sum v_i^2}$, derived from repeated Pythagoras. How do you normalize a vector? ::: Divide by its length: $\hat{\mathbf v}=\mathbf v/\|\mathbf v\|$, giving length 1, same direction. Define the dot product. ::: $\mathbf u\cdot\mathbf v=\sum u_i v_i$ — a scalar. Geometric meaning of dot product? ::: $\mathbf u\cdot\mathbf v=\|\mathbf u\|\|\mathbf v\|\cos\theta$. When are two vectors perpendicular? ::: When $\mathbf u\cdot\mathbf v=0$. What is $\mathbf v\cdot\mathbf v$? ::: $\|\mathbf v\|^2$, the squared length. Derive the angle formula's key cancellation. ::: Expand $\|\mathbf u-\mathbf v\|^2$ two ways (Law of Cosines vs dot expansion); the $\|\mathbf u\|^2,\|\mathbf v\|^2$ cancel leaving $\mathbf u\cdot\mathbf v=\|\mathbf u\|\|\mathbf v\|\cos\theta$. What does scaling by $c<0$ do geometrically? ::: Stretches length by $|c|$ and flips direction. --- ## Connections - [[Linear Combinations and Span]] — addition + scaling are the engine of spans. - [[Dot Product and Orthogonality]] — deeper consequences (projections, Cauchy–Schwarz). - [[Norms and Distance in Rn]] — generalizing the length idea. - [[Vector Spaces — Axioms]] — ℝⁿ is the prototype that the axioms abstract. - [[Projections and Orthogonal Decomposition]] — built directly from $\mathbf u\cdot\mathbf v$. - [[Cross Product (R3 only)]] — contrast: a *vector*-valued product unique to 3D. ## 🖼️ Concept Map ```mermaid flowchart TD V[Vector in Rn as n-tuple] P[Point / address] A[Arrow / displacement] ADD[Vector addition] SCALE[Scalar multiplication] CW[Component-wise rule] PYTH[Pythagorean theorem] NORM[Euclidean norm / length] UNIT[Unit vector / normalize] DOT[Dot product] V -->|interpreted as| P V -->|interpreted as| A A -->|enables| ADD A -->|enables| SCALE ADD -->|defined| CW SCALE -->|defined| CW ADD -->|geometrically| A PYTH -->|applied per axis| NORM NORM -->|scale to length 1| UNIT DOT -->|self product gives| NORM DOT -->|sums products of| CW ``` ## 🔊 Hinglish (regional understanding) > [!intuition]- Hinglish mein samjho > Dekho, ek **vector** matlab numbers ki ek ordered list — jaise $(3,4)$. Lekin iska asli kamaal yeh > hai ki yeh do cheezein ek saath represent karta hai: ek **point** (kahan ho space mein) aur ek > **arrow** (kaise move karna hai origin se). Isi dual picture pe poori linear algebra khadi hai. > > Do hi basic operations hain. **Addition** aur **scalar multiplication**, dono **component-wise** > hote hain — har axis alag hai, isliye east mein chalo toh north pe asar nahi padta. Addition ka > geometric matlab parallelogram ya tip-to-tail rule hai. **Length (norm)** hum Pythagoras se derive > karte hain: $\|\mathbf v\|=\sqrt{v_1^2+\dots+v_n^2}$. Length 1 wale vector ko **unit vector** kehte > hain, aur kisi vector ko uski length se divide karke normalize kar dete hain. > > Sabse important: **dot product** $\mathbf u\cdot\mathbf v=\sum u_i v_i$. Yeh ek single number deta > hai (vector nahi!) jo angle batata hai: $\mathbf u\cdot\mathbf v=\|\mathbf u\|\|\mathbf v\|\cos\theta$. > Agar dot product **zero** hai, toh vectors **perpendicular** hain — yahi rule computer use karta hai > direction check karne ke liye. Ek common galti: log sochte hain dot product bhi vector deta hai ya > multiply bhi component-wise hota hai — nahi! Dot ka result hamesha scalar hota hai. Yeh basics itne > strong rakho ki span, projection, orthogonality sab automatic samajh aayega. ![[audio/4.5.01-Vectors-in-Rn-—-operations,-geometric-interpretation.mp3]]

Go deeper — visual, from zero

Test yourself — Linear Algebra (Full)

Connections