Every symbol you'll see in this chapter, named and explained. When a new one appears, refer back here.
$\mathbb{R}$Blackboard R
The set of all real numbers — every number on the number line: negative, zero, positive, decimals, irrationals like π. The double-struck style of R is standard in mathematics to distinguish it from an ordinary R.
$\mathbb{R}^n$R-n
The set of all vectors with exactly n real-number components. R2 is the 2D plane, R3 is 3D space, R100 is 100-dimensional space — used in machine learning constantly.
$\mathbf{v}$Bold v — vector
A vector. Bold lowercase letters always denote vectors. Plain lowercase like v (no bold) typically denotes a scalar — a single number, not a list.
$v_i$v sub i — component
The i-th entry of vector v. The subscript i is an index that selects a slot. v1 is the first entry, v2 the second, vn the last.
$\mathbf{v}^T$v transpose
The superscript T means transpose — flip the column vector into a row vector. A column (35) becomes the row (35). Critical for writing dot products as matrix multiplication.
$\in$"in" / element of
Membership. v∈Rn reads "v is an element of Rn" — meaning v belongs to that space. Think of it as the mathematical word "in."
$\sum$Sigma — summation
Greek capital letter sigma. Means "add up a sequence." ∑i=1nvi means: start at i=1, go up to i=n, and add v1+v2+⋯+vn. A compact way to write long sums.
$\|\mathbf{v}\|$Norm of v — length
The Euclidean length (magnitude) of a vector — how long the arrow is. The double vertical bars are the norm notation. Always a non-negative number.
$\mathbf{u} \cdot \mathbf{v}$Dot product
An operation between two vectors that returns a single number (a scalar). Computed by multiplying corresponding components and summing. The dot ⋅ distinguishes this from scalar multiplication.
$\mathbf{0}$Zero vector
The vector where every component is 0. Bold to distinguish from the number zero. 0∈Rn is an n-component vector of zeros — the "do nothing" element of a vector space.
$\exists$"there exists"
Existential quantifier. ∃0 means "there exists a zero vector." Used in formal definitions to assert that something exists without naming it explicitly.
$\forall$"for all"
Universal quantifier. ∀v∈V means "for every vector v in V" — the statement that follows must hold without exception.
$c,\ d$Scalars
Plain (non-bold) letters representing single real numbers. Called "scalars" to contrast with vectors. They scale vectors — stretching, shrinking, or flipping them.
$\theta$Theta — angle
Greek lowercase letter theta. In this chapter it represents the angle between two vectors. You'll encounter it again in the dot product's geometric formula.
$\cos\theta$Cosine of theta
A trigonometric function that measures how aligned two directions are. cos(0°)=1 (same direction), cos(90°)=0 (perpendicular), cos(180°)=−1 (opposite). Appears inside the dot product's geometric formula.
$\sqrt{\phantom{x}}$Square root
x is the number which, multiplied by itself, gives x. Example: 25=5 because 5×5=25. Used in the norm formula to "undo" the squaring of components.
$\hat{\mathbf{v}}$v-hat — unit vector
The hat accent means the vector has been normalized — its length is exactly 1. Direction is preserved, magnitude is removed. Read aloud as "v hat."
$\dim(V)$Dimension of V
The number of vectors in any basis of vector space V. It measures the "degrees of freedom" — how many independent directions exist in the space.
$\text{span}\{\cdot\}$Span
The set of all possible linear combinations of the vectors inside the braces. Represents every point reachable by mixing those vectors with any real-number coefficients.
01 · What is a Vector?
A vector is an ordered list of numbers. "Ordered" means position matters — the first slot is different from the second slot.
Think of it as coordinates. If you say "I'm 3 blocks east and 5 blocks north," you've described a position using two numbers in a specific order — that's a vector: (35).
Definition — Vector in $\mathbb{R}^n$
An n-dimensional vector is an ordered list of n real numbers, written vertically as a column:
v=v1v2⋮vn∈Rn
v — bold lowercase, the vector itself.
v1,v2,…,vn — the individual numbers inside, called components or entries.
∈Rn — reads "is an element of R-n," meaning this vector lives in n-dimensional real space.
⋮ — vertical dots meaning "and so on, continuing the pattern."
Concrete Examples
Example — 2D Vector
A stock has return 4% and volatility 2%. As a vector in R2:
v=(42)
First slot (v1) = 4 → return. Second slot (v2) = 2 → volatility. Order is fixed — swapping them would mean something completely different.
Example — 3D Vector
A point in 3D space at x=1, y=−3, z=7:
p=1−37∈R3
v1=1, v2=−3, v3=7. Negative numbers are perfectly valid.
Geometric Picture
In 2D, a vector (35) is an arrow starting at the origin (0,0), pointing to the point (3,5). The two numbers tell you how far right and how far up to go. This arrow interpretation is critical — it lets you visualize addition and scaling.
Row vs Column
Vectors written horizontally like (3,5) are row vectors. Vectors written vertically (as above) are column vectors. Default in linear algebra: column. When you see vT (v-transpose), it means flip the column into a row: vT=(35). This distinction matters a lot for matrix multiplication later.
02 · Vector Operations
Vector Addition
Add two vectors by adding their components in the same position. First slot with first slot, second with second, and so on. Both vectors must have the same number of components — you cannot add a 2D vector to a 3D vector.
Step-by-step — Adding $\mathbf{u} = \begin{pmatrix}2\\4\\-1\end{pmatrix}$ and $\mathbf{v} = \begin{pmatrix}3\\-2\\5\end{pmatrix}$
Confirm same dimension: both have 3 components. u,v∈R3. We can add them.
Add slot 1:u1+v1=2+3=5. This becomes the first entry of the result.
Add slot 2:u2+v2=4+(−2)=2. Adding a negative is the same as subtracting.
Add slot 3:u3+v3=(−1)+5=4.
Assemble the result:u+v=524.
Geometric meaning: place the tail of v at the tip of u. The result is the arrow from the origin to where v's tip ends up. Like walking 2 blocks east then 3 blocks north — the total displacement is 2+3 in each direction.
Common mistake — Mismatched Dimensions
You cannot add (24)∈R2 and 135∈R3. There's no third slot in the first vector to pair with the 5. This is undefined — full stop.
Scalar Multiplication
Multiply a vector by a single number (a scalar). Multiply every component by that number. This stretches or shrinks — and possibly flips — the arrow.
Definition — Scalar Multiplication
cv=cv1v2⋮vn=cv1cv2⋮cvn
c is the scalar — just a real number. It's not bold because it's not a vector.
Step-by-step — Computing $-2 \cdot \mathbf{v}$ where $\mathbf{v} = \begin{pmatrix}3\\-1\\4\end{pmatrix}$
Identify scalar and vector: scalar c=−2, vector v=3−14.
Multiply slot 1:(−2)×3=−6. Negative times positive = negative.
Multiply slot 2:(−2)×(−1)=2. Negative times negative = positive.
Multiply slot 3:(−2)×4=−8.
Result:−2v=−62−8. The scalar c=−2 doubled the length (∣−2∣=2) and flipped direction (negative sign).
Special cases:c=0 gives the zero vector 0. c=1 gives back v unchanged. c=−1 flips the arrow to point the opposite direction with the same length.
Dot Product
The most important operation in this chapter. Multiply corresponding components together, then add all those products up. The result is a single number (a scalar), not a vector.
Definition — Dot Product
u⋅v=u1v1+u2v2+⋯+unvn=∑i=1nuivi
∑i=1n — "sum from i=1 to n." The index i steps through 1,2,3,…,n, and for each value of i you compute uivi, then add them all.
uivi — the i-th component of u multiplied by the i-th component of v.
Pair slot 1:u1×v1=2×4=8. (First component of each vector.)
Pair slot 2:u2×v2=(−1)×5=−5. (Second component of each vector.)
Pair slot 3:u3×v3=3×(−2)=−6. (Third component of each vector.)
Sum all products:u⋅v=8+(−5)+(−6)=8−5−6=−3. Result is −3, a scalar. The dot product is negative here — we'll see what that means geometrically next.
Geometric Meaning of the Dot Product
There is a second formula for the dot product that reveals its geometric meaning:
u⋅v=∥u∥∥v∥cosθ
where θ is the angle between the two vectors, ∥u∥ and ∥v∥ are the lengths of the vectors (always positive), and cosθ is the cosine of the angle.
Definition — What the sign of the dot product tells you
Positive:u⋅v>0⟹cosθ>0⟹θ<90°. Vectors point roughly in the same direction.
Zero:u⋅v=0⟹cosθ=0⟹θ=90°. Vectors are perpendicular (called orthogonal). This is hugely important in PCA.
Negative:u⋅v<0⟹cosθ<0⟹θ>90°. Vectors point in opposing directions.
Norm (Vector Length)
The norm is the Euclidean length of a vector — how long the arrow is. It's always a non-negative number.
Definition — Euclidean Norm (L2 Norm)
∥v∥=v12+v22+⋯+vn2=∑i=1nvi2
∥v∥ — double bars denote the norm. The "L2" label means we're squaring, summing, then square-rooting (as opposed to other norms which use different powers). This extends Pythagoras' theorem to n dimensions.
Step-by-step — Norm of $\mathbf{v} = \begin{pmatrix}2\\-3\\6\end{pmatrix}$
Square each component:v12=22=4, v22=(−3)2=9, v32=62=36. Note: squaring makes negatives positive, so (−3)2=9 not −9.
Sum the squares:4+9+36=49. This number came from: 4 (from squaring 2) +9 (from squaring −3) +36 (from squaring 6).
Take the square root:∥v∥=4+9+36=49=7, because 7×7=49.
Unit Vectors — Normalizing
A unit vector has norm exactly equal to 1. To convert any vector to a unit vector, divide by its norm. This preserves direction but removes magnitude.
Compute the norm:∥v∥=32+42=9+16=25=5. Numbers 9 and 16 came from squaring 3 and 4 respectively.
Divide every component by 5:v^=∥v∥v=51(34)=(3/54/5)=(0.60.8).
Verify:∥v^∥=(0.6)2+(0.8)2=0.36+0.64=1=1.
03 · Linear Combinations
A linear combination means: take a set of vectors, multiply each by a scalar, and add the results. You're mixing vectors together. This is the single most fundamental operation in linear algebra — everything else builds on it.
Definition — Linear Combination
c1v1+c2v2+⋯+ckvk=∑i=1kcivi
c1,c2,…,ck — scalars called coefficients. They control how much of each vector you use.
v1,v2,…,vk — the vectors being combined. The subscripts here are labels (vector 1, vector 2...), not component indices.
k — the number of vectors in the combination.
Step-by-step — $3\mathbf{v}_1 - 2\mathbf{v}_2$ where $\mathbf{v}_1=\begin{pmatrix}1\\0\end{pmatrix}$, $\mathbf{v}_2=\begin{pmatrix}2\\1\end{pmatrix}$
Identify coefficients and vectors:c1=3 with v1, and c2=−2 with v2.
Scale v1 by 3:3v1=3(10)=(30).
Scale v2 by −2:−2v2=−2(21)=(−4−2).
Add the scaled vectors component-by-component:(30)+(−4−2)=(3+(−4)0+(−2))=(−1−2).
This result (−1−2) is one particular linear combination. By changing c1 and c2 to any real numbers, you can produce infinitely many different vectors — this is the idea behind span.
04 · Span
Definition — Span
The span of vectors {v1,…,vk} is the set of all vectors you can produce by forming every possible linear combination:
span{v1,…,vk}={c1v1+⋯+ckvk∣c1,…,ck∈R}
The set-builder notation reads: "the set of all things of the form [left side] where [right side] is the condition." Here: all linear combinations where the scalars are real numbers.
Example — Single Vector Spans a Line
What is span{(12)}?
Only one vector, so any linear combination is just c⋅(12)=(c2c) for any c∈R.
This traces out a line through the origin in the direction (1,2). Points like (24), (−3−6), (00) are all on this line — all in the span. But (13) is NOT, because c=1 gives (12), not (13).
Example — Two Non-Parallel Vectors Span a Plane
What is span{(10),(01)}?
Any combination: c1(10)+c2(01)=(c1c2). Since c1 and c2 are any real numbers, this produces every point in R2. The span is the entire 2D plane.
Common mistake — Parallel Vectors Have Limited Span
span{(12),(24)} — notice that (24)=2(12). These are parallel (same direction, different length). Any combination c1(12)+c2(24)=(c1+2c2)(12) is still just a multiple of the first vector. Span is still only a line, not the plane — the second vector adds no new direction.
05 · Vector Spaces
A vector space is a set V with two operations (addition and scalar multiplication) that satisfy 8 rules. The key idea: these operations must never take you outside the set — the space is self-contained.
Definition — Vector Space
A set V over R is a vector space if ∀u,v∈V and ∀c∈R:
u+v∈V(closed under addition)cv∈V(closed under scalar multiplication)
∀ — "for all." This must hold for every possible pair of vectors, not just some.
Closed — the result stays inside V. The space doesn't "leak."
The 8 Axioms
These aren't arbitrary rules. Each one captures something that must be true for the math to be consistent and useful.
Axiom
Rule
Why it matters
1. Commutativity
u+v=v+u
Order of addition doesn't matter — walking east then north = north then east.
2. Associativity
(u+v)+w=u+(v+w)
Grouping doesn't matter; lets you drop parentheses.
3. Zero vector
∃0∈V such that v+0=v
A "do nothing" element exists — the origin.
4. Additive inverse
∀v,∃(−v) such that v+(−v)=0
Every vector has an opposite; allows subtraction.
5. Scalar identity
1⋅v=v
Multiplying by 1 is neutral.
6. Scalar associativity
(cd)v=c(dv)
Scaling twice = scaling by product; 2×3=6.
7. Distributive (vector)
c(u+v)=cu+cv
Scalar distributes over vector sum.
8. Distributive (scalar)
(c+d)v=cv+dv
Vector distributes over scalar sum.
Example — $\mathbb{R}^2$ Is a Vector Space
Take u=(13) and v=(−24), both in R2.
u+v=(−17)∈R2 — still a 2D vector.
5v=(−1020)∈R2 — still a 2D vector.
All 8 axioms hold. R2 is a vector space.
Common mistake — The First Quadrant Is Not a Vector Space
Let V be all vectors in R2 with non-negative entries: x≥0, y≥0 — the first quadrant.
Take v=(12)∈V. Compute (−1)v=(−1−2). Both components are negative, so (−1−2) is not in V.
Axiom 4 (additive inverse) fails — −v is not in the set. V is not a vector space.
06 · Subspaces
A subspace is a subset W⊆V that is itself a vector space under the same operations. Instead of checking all 8 axioms (they're inherited from V), you only need 3 checks.
Definition — Subspace Test (3 Conditions)
W is a subspace of V if and only if:
S1.0∈W — the zero vector is in W.
S2.u,v∈W⟹u+v∈W — closed under addition.
S3.v∈W,c∈R⟹cv∈W — closed under scalar multiplication.
Step-by-step — Is the x-axis a subspace of $\mathbb{R}^2$?
Set up: The x-axis in R2 is all vectors of the form (x0) where x∈R. Call this set W.
Check S1: Does W contain 0? Set x=0: (00)∈W. Yes.
Check S2: Take any two elements: (a0)+(b0)=(a+b0). Second component is still 0, so the result is in W. Yes.
Check S3:c(a0)=(ca0). Second component stays 0. Still in W. Yes.
Conclusion: All three conditions pass. The x-axis is a subspace of R2.
Common mistake — A Line Not Through the Origin Is Not a Subspace
Let W={(xx+1)∣x∈R} — a line shifted up by 1.
Check S1: Does (00)∈W? We'd need x such that x=0 and x+1=0 simultaneously. Impossible — 0+1=1=0. Zero vector is NOT in W.
Conclusion: Fails the very first test. Not a subspace. Every subspace must contain the origin.
07 · Linear Independence
Vectors are linearly independent if none of them can be built from linear combinations of the others. Each vector contributes a genuinely new direction that the others can't replicate.
Intuition: if you're describing a route, you don't need "go east" if you already have "go north" and "go northeast" — northeast is a combination of the other two. That redundancy = linear dependence.
Definition — Linear Independence
Vectors {v1,…,vk} are linearly independent if the only solution to:
c1v1+c2v2+⋯+ckvk=0
is c1=c2=⋯=ck=0 (all coefficients must be zero).
If any non-zero solution exists, the vectors are linearly dependent.
Why this definition? If one vector, say v3, equals 2v1−v2, then 2v1−v2−v3=0 — a non-zero solution with c1=2,c2=−1,c3=−1. The equation catches the redundancy.
Example — Linearly Independent Vectors
Test v1=(10), v2=(01).
Set up: c1(10)+c2(01)=(00).
Computing the left side: (c10)+(0c2)=(c1c2)=(00).
Match components: slot 1 gives c1=0. Slot 2 gives c2=0. The only solution is c1=c2=0. Linearly independent.
Common mistake — Parallel Vectors Are Linearly Dependent
Test v1=(12), v2=(36).
Notice: v2=3v1 — every component of v2 is exactly 3 times v1. They're parallel.
A non-zero solution exists (c1=3,c2=−1). Linearly dependent.v2 is redundant — it adds no new direction.
08 · Basis & Dimension
A basis is the most efficient set of vectors that fully describes a vector space — no redundancy, no gaps. Think of it as the minimal vocabulary needed to express every vector in the space.
Definition — Basis
A set B={b1,…,bk} is a basis for vector space V if:
B1.B is linearly independent (no redundancy).
B2.span(B)=V (every vector in V can be reached).
Example — Standard Basis of $\mathbb{R}^2$
The standard basis is:
e1=(10),e2=(01)
Independent? Yes — shown above. Spans R2? Yes — any vector (xy)=xe1+ye2, so c1=x, c2=y gives every point. It's a basis.
The letters e stand for "elementary" or "standard." The subscript tells which slot is 1 — all other slots are 0.
Bases are not unique
{(11),(1−1)} is also a valid basis for R2 — linearly independent and spans the plane. A space has infinitely many bases, but all bases for the same space have the same number of vectors. That number is the dimension.
Definition — Dimension
The dimension of a vector space V, written dim(V), is the number of vectors in any basis of V. It is always the same regardless of which basis you choose.
dim(Rn)=n
A line through the origin has dim=1. A plane has dim=2. In machine learning, a dataset with 500 features lives in R500, dim=500 — until PCA reduces it.
09 · Exercises
EXERCISE 1.1
Scale v by 3 first (multiply every component by 3), then add component-by-component to u.
Compute 3v=312−3=36−9.
Then add component-by-component: u+3v=2+3−1+64+(−9)=55−5.
Compute u+3v where u=2−14 and v=12−3. Show every component step.
EXERCISE 1.2
Multiply corresponding components and sum. The sign of the result tells you the angle type: positive means acute, zero means right angle, negative means obtuse.
Compute each product and sum: 2(1)+(−1)(2)+4(−3)=2−2−12=−12.
The dot product is −12. Since it is negative, cosθ<0, which means θ>90° — the angle is obtuse.
Find the dot product u⋅v for u=2−14 and v=12−3. Is the angle between them acute, right, or obtuse?
EXERCISE 1.3
Square each component, sum the squares, then take the square root to get the norm. Then divide every component by the norm to obtain the unit vector.
Square each component: 02+(−5)2+122=0+25+144=169.
Take the square root: ∥w∥=169=13.
Divide every component by 13: w^=1310−512=0−5/1312/13.
Compute ∥w∥ for w=0−512, then find the unit vector w^.
EXERCISE 1.4
You need a scalar c such that c(2−1)=(4−2). Try solving for c using the first component, then verify the second component is also satisfied.
From the first component: 2c=4, so c=2.
Verify with the second component: (−1)(2)=−2. That matches the second component of (4−2).
Yes, (4−2) is in span{(2−1)} with c=2.
Is (4−2) in span{(2−1)}? Show why.
EXERCISE 1.5
Set up c1v1+c2v2+c3v3=0 and check if a non-zero solution exists. Hint: notice whether v3=v1+v2.
Observe that v3=112=101+011=v1+v2.
Therefore 1⋅v1+1⋅v2+(−1)⋅v3=0 is a non-zero solution (c1=1,c2=1,c3=−1).
Linearly dependent.v3 is redundant — it is exactly the sum of the other two vectors.
Are v1=101, v2=011, v3=112 linearly independent?
EXERCISE 1.6
The dot product w⋅r=∑wiri is a weighted average of the returns. To verify the weights are valid, check that w⋅1=0.4+0.3+0.3=1.
Compute each product and sum: 0.4(0.08)+0.3(0.05)+0.3(0.12)=0.032+0.015+0.036=0.083.
Portfolio expected return = 8.3%.
Weights check: 0.4+0.3+0.3=1.0 — fully invested, no leverage.
A bond portfolio has positions in three assets with weights w=0.40.30.3 and expected returns r=0.080.050.12. Compute the portfolio expected return w⋅r using the dot product, and verify that the weights form a valid portfolio (w⋅1=1).
10 · Chapter Summary
Concept
Formula / Rule
Vector in Rn
Ordered list of n reals; bold v
Addition
Component-wise; same dimension required
Scalar mult.
Multiply every component by c
Dot product
u⋅v=∑uivi; zero means orthogonal
Norm
∥v∥=∑vi2; length of arrow
Unit vector
v^=v/∥v∥; norm = 1
Linear combination
∑civi; the core building block
Span
All reachable by linear combinations
Vector space
Closed under + and scalar mult.; 8 axioms
Subspace test
Contains 0; closed under + and scalar mult.
Linear independence
Only zero solution to ∑civi=0
Basis
Independent set that spans the space
Dimension
Number of vectors in any basis
Next: Chapter 02 — Matrix Operations extends vectors into rectangular grids of numbers, defining addition, scalar multiplication, and the powerful (but non-commutative) matrix product.