Normalizing a vector divides it by its own length, leaving direction intact and magnitude at exactly 1. Do it to every row of a matrix and you get a set of embeddings that can be compared purely by direction.
normalized_row = row / sqrt(Σ row[i]²)
Task: write normalize_rows(matrix) returning the matrix with each row scaled to unit length, rounded to 4 decimal places.
This is what makes cosine similarity cheap. Once every row is unit length, the cosine between two of them is just their dot product — no division left to do, which is exactly how vector databases compare millions of embeddings quickly.