Representing information / 2 of 7
Vectors, matrices, and similarity
What you’ll learn
- Explain the main idea of “Vectors, matrices, and similarity” in your own words.
- Trace a concrete example and identify the assumptions behind it.
- Apply the principle in a practice problem and recognize a common failure.
The idea, intuitively
Vectors can represent direction, measurements, or learned features. Length measures magnitude; angle can measure alignment. An embedding is a learned vector, not a transparent list of human concepts.
Use small numbers first and work one operation at a time. Track the shape and units of every quantity before doing algebra. The equations here describe idealized objects; implementing them on a computer introduces finite precision and resource constraints. You can understand the mechanism before learning every proof.
Under the hood
Cosine similarity divides the dot product by both vector norms. It is undefined for a zero vector. Normalizing vectors removes magnitude information, which is useful only when direction is what matters.
High vector similarity does not prove two statements have the same truth value.
A worked example
Vectors [1, 0] and [0, 1] have cosine 0; [1, 0] and [2, 0] have cosine 1 despite different lengths.
How to use this way of thinking
Check a symbolic result with a numeric example, then consider an edge case such as zero, a very large value, or an incompatible shape. Explain what each symbol means rather than memorizing the equation. If a result surprises you, inspect the assumptions and the units first.
Try it yourself
Find the cosine of [1,1] and [1,−1].
Key takeaways
- Direction
- High vector similarity does not prove two statements have the same truth value.
- Check the assumptions with a small example before applying this idea to a larger system.
Check your understanding
Use feedback to learn. Quiz scores and lesson completion are tracked separately.
Go to lesson completionFurther reading
Original papers and reference material for this school. External resources may be in English and require internet access.
Mathematics for Machine Learning (open textbook) (opens a new tab)Finish this lesson
Mark this lesson complete when you’re ready to continue.