Step by step
The question
Question: find the dot product of (1, −1, 2) and (2, 3, 1).
u = [1; −1; 2], v = [2; 3; 1]
The dot product u dot v: multiply matching entries, top with top and so on.
Then add them all.
The answer is one number.
u • v: matching entries multiplied, then added
1 Multiply matching entries
1 × 2 + (−1) × 3 + 2 × 1.
u • v = 1 × 2 + (−1) × 3 + 2 × 1
We work out each times.
u • v = 2 − 3 + 2
2 Add them
Then we add: u • v = 1.
u • v = 1
Careful!
The dot product is one number, not a vector.
The products are added together.
Careful: one number, not a vector
3 Check
Let's check the other way round: v dot u.
The same products, so the same number.
v • u = 2 × 1 + 3 × (−1) + 1 × 2 = 2 − 3 + 2
= 1
We get 1 again.
So the answer is right!
Let's look back.
First: multiply matching entries.
Then: add them.
Last: check.
Answer
Careful: one number, not a vector