Chapter 2
Vectors
Vectors as data, positions, directions, weighted sums, and the beginning of representation geometry.
What this chapter does
Vectors are small lists of numbers with meaning. This chapter begins with coordinates and simple arithmetic, then connects vectors to weighted sums, similarity, embeddings, and attention scores.
Lessons
Read these in order.
Start with the chapter introduction, then move through the topic lessons. The order is chosen so each page can reuse ideas from the pages before it.
- 01Introduction
Why vectors come early in the Mathematics path and where they appear in ML.
- 02What Is a Vector?
A first lesson on vectors as lists of numbers with meaning.
- 03Vectors as Position and Direction
Two common readings of the same coordinates: location and movement.
- 04Vector Addition
Combining movements and data by adding matching coordinates.
- 05Subtraction and Scalar Multiplication
Difference vectors and stretching or flipping vectors with one number.
- 06Dot Product
Multiplying matching entries, adding them, and reading the result as a score.
- 07Norms and Distance
Vector length and distance as the length of a difference vector.
- 08Angles and Cosine Similarity
How direction becomes a useful measure of similarity.
- 09Projection
How much of one vector lies along another direction.
- 10Vectors in Embeddings
Why learned representations are vectors and how vector operations compare them.
Review and practice
Close the chapter deliberately.
Use the conclusion and revision notes before the chapter exercises. Hints and solutions are collected here, while lesson-level exercises reveal their own help inline.
What Chapter 2 accomplished and how vectors prepare the matrix chapter.
Summary and Revision NotesA compact review of vector operations, notation, and common traps.
ExercisesChapter-level practice for vector arithmetic and interpretation.
HintsLow-spoiler nudges for the Chapter 2 exercises.
SolutionsExplained solutions for the Chapter 2 exercises.
Before moving on
- Compute with coordinates by hand.
- Read a vector as data, position, or direction.
- Use dot products as weighted sums.
- Connect vector ideas to embeddings and attention scores.
Where this leads
- Matrix-vector multiplication
- Similarity search
- Embedding geometry
- Attention scores