An agency compares two grant-topic vectors. One document is much longer, yet the mix of topics points the same way, and the team wants a score that ignores length and compares direction. Which measure does that?
Select an answer to reveal the explanation.
Short Explanation
Two arrows can point the same way even when one is much longer, and you can score the direction while ignoring length. Cosine similarity does that for the grant-topic vectors. A raw gap or an unnormalized product still grows when the document gets longer.
Full Explanation
Cosine similarity divides the dot product of two vectors by the product of their lengths. The lengths cancel, so only the angle remains: two grant documents with the same mix of topics score alike even when one vector is much longer. Euclidean distance is the straight-line gap between the tips of the vectors, and stretching one vector along the same direction moves its tip and changes that gap. Manhattan distance adds absolute coordinate gaps, and scaling both vectors up scales those gaps, so length still enters the score. The raw dot product multiplies matching coordinates and sums them, and a longer document with the same direction produces a larger product, so magnitude is not removed. Direction here is the pattern of topic weights, not the word count that produced them, and dividing by both lengths strips that scale. Exam caveat: cosine is undefined for a zero vector, and a document with no topic weights has no direction to compare. Operational check: scale one grant vector by a positive constant other than one, recompute the score, and confirm cosine stays the same while the dot product and the two distances change.