What does the dot product of two vectors measure, and what does it mean when the dot product is zero? What is for and ?
Linear algebra and optimisation, Vectors and dot product
Level L1 Beginner. Length Short. Nature Th+Mat Both.
What's being asked
Whether you know the dot product is one number that says how much two vectors point the same way, and can do the tiny multiply-and-add.
Key idea
A vector is a list of numbers, such as a point or an arrow on a map. The dot product multiplies matching entries and adds them: . A large positive value means the arrows point roughly the same way, a negative value means roughly opposite ways, and exactly zero means they are at a right angle (perpendicular, also called orthogonal).
Steps
- Say what a vector is: an ordered list of numbers, like a step of 2 east and 1 north. Here is 2 east, 1 north and is 1 east, 2 south.
- Multiply matching entries: and .
- Add them: .
- Read the result: zero means and are perpendicular. Sketch both arrows from the origin to see the right angle.
- Say why it matters: models use the dot product to measure similarity. A weight vector dotted with a feature vector gives a score.
Common mistakes
- Thinking the answer is a vector. The dot product of two vectors is a single number.
- Saying zero means the vectors are equal or that one is the zero vector. Zero only says they are perpendicular (or one of them is the zero vector).
- Multiplying the first entry of with the second entry of . Always pair entries in the same position.
How long your answer should be
About 1 minute; two lines of arithmetic and one sentence of meaning.
Read this
Previous in Linear algebra and optimisation: none
Next in Linear algebra and optimisation: What is a vector norm, how do the (Manhattan) norm and the (Euclidean) norm differ geometrically, and what are both norms for ?