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.

  1. 01
    Introduction

    Why vectors come early in the Mathematics path and where they appear in ML.

  2. 02
    What Is a Vector?

    A first lesson on vectors as lists of numbers with meaning.

  3. 03
    Vectors as Position and Direction

    Two common readings of the same coordinates: location and movement.

  4. 04
    Vector Addition

    Combining movements and data by adding matching coordinates.

  5. 05
    Subtraction and Scalar Multiplication

    Difference vectors and stretching or flipping vectors with one number.

  6. 06
    Dot Product

    Multiplying matching entries, adding them, and reading the result as a score.

  7. 07
    Norms and Distance

    Vector length and distance as the length of a difference vector.

  8. 08
    Angles and Cosine Similarity

    How direction becomes a useful measure of similarity.

  9. 09
    Projection

    How much of one vector lies along another direction.

  10. 10
    Vectors in Embeddings

    Why learned representations are vectors and how vector operations compare them.

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

Chapter progress