Index Ai Academy
Phase 2 · Math, when you need it · Linear algebra

Vector arithmetic and length

Add, scale and measure vectors.

About 25 minutes · Free account required

Open this lesson Create a free account

Why it matters

Most of what AI models do to data comes down to four moves: add vectors, stretch them, measure how long they are, and measure how far apart they are. "Find customers like this one" is a distance measurement. AI search compares the directions of word vectors. Even the famous trick "king − man + woman ≈ queen" is just subtracting and adding lists of numbers. Learn these four moves and you have the vocabulary for everything that follows.

What you'll be able to do

  • Add, subtract and scale vectors, in code and as pictures
  • Compute a vector's length (norm) and the distance between two vectors
  • Normalize a vector to length 1 and say why embeddings often are
  • Find the nearest neighbor of a vector by distance

Before this lesson

Next in this phase: Dot product and cosine similarity