Take the lists and . Compute the cosine of the angle between them, to three decimal places, and say whether they agree more or less than the two shoppers of section 8.1, whose cosine is 0.96.
Worked solution
The dot product is . The first norm is , and the second is , so the product of the norms is . The cosine is . The angle is , while the shoppers' cosine of 0.96 gives about , so this pair agrees less than the two baskets of section 8.1. The two lists hold the same two numbers in the other order, and the score below 1 measures that difference. A cosine of 0.8 is a strong positive score: the scale runs from to , so 0.8 sits close to the top and says the lists point mostly the same way.