Compute the length of a vector
Take the square root of the dot product with itself. The idea in plain words, a worked example, and a check with the answers shown — part of the free Linear Algebra guides.
The dot product of a vector with itself is the squared length, so one square root is still owed.
In the plane this is Pythagoras with the two entries as the legs: for,
Never negative, because it is a square root of a sum of squares.
Two facts worth internalising, because they cost marks repeatedly.
Lengths do not add. is not in general. Expanding:, so the cross term decides. For and the lengths are and, and — not. Lengths add only when the vectors point the same way.
A distance is the length of a difference. The distance between and is, and computing it means differencing first, then taking the length of the result. Subtracting the two lengths gives, which can be negative and which measures something else entirely: how much longer one vector is, not how far apart their tips are.
Both facts come from the same place — the length is a square root, and square roots do not distribute over sums.
Two dimensions.:. The classic.
Four dimensions.:, so. Note how much larger the squared length is than the length — it is easy to report by accident, and is the wrong answer by a factor of.
A distance. and:, so. Same arithmetic as the first example, after one subtraction first. Subtracting lengths instead would give, which is negative — impossible for a distance.
- Take the square root of the dot product with itself
- Keep the squared length and the length apart
- Compute a distance by differencing first and taking the length second
- Bound a distance between two vectors using the triangle inequality
(a)?
(b). What is?
(c) and. Compute and and compare.
Answers
(a).
(b). One square root.
(c), so; while. They differ, which is the general case — lengths add only when the vectors point the same way. The gap is the cross term: against.