Step by step
The question
Question: find the dot product of (3, 1, 2) and (−2, 4, 1).
u = [3; 1; 2], v = [−2; 4; 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
3 × (−2) + 1 × 4 + 2 × 1.
u • v = 3 × (−2) + 1 × 4 + 2 × 1
We work out each times.
u • v = −6 + 4 + 2
2 Add them
Then we add: u • v = 0.
u • v = 0
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 × 3 + 4 × 1 + 1 × 2 = −6 + 4 + 2
= 0
We get 0 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