What is a vector norm, how do the (Manhattan) norm and the (Euclidean) norm differ geometrically, and what are both norms for ?
Linear algebra and optimisation, Matrix norms and condition number
Level L1 Beginner. Length Short. Nature Th+Mat Both.
What's being asked
Whether you know how vector length is measured in machine learning (ML), which underlies distances in k-nearest neighbours (k-NN) and regularisation penalties like L1 and L2.
Key idea
A vector norm measures the length (size) of a vector from the origin and is always non-negative. The norm adds absolute steps along each axis like walking on a city street grid, whereas the norm is the straight-line crow-flies distance.
Steps
- Explain what a norm is in plain words: a single non-negative number saying how big a vector is, equal to only for the zero vector, and scaling linearly when you stretch the vector.
- Contrast the geometry using a city grid analogy: to reach from along streets, you walk 3 blocks east and 4 blocks south (); flying straight across the diagonal gives the shorter Euclidean path ().
- Compute the norm for : .
- Compute the norm for : , noting that always holds.
Common mistakes
- Forgetting to take absolute values in the norm, getting instead of .
- Forgetting the square root in the norm (reporting the squared norm instead of ).
- Assuming and balls have the same shape in 2-D: points with form a circle, whereas points with form a diamond with corners on the axes.
How long your answer should be
About 2 minutes: city-grid vs straight-line analogy, plus the 3-4-5 calculation.
Read this
- Dive into Deep Learning: Linear Algebra: Section 1.3.4 'Norms' (1.3.4.1 'Euclidean Length and Angle' and 1.3.4.2 'The l1, lp, and Frobenius Norms'): defines vector norms clearly with properties and formulas.
Previous in Linear algebra and optimisation: What does the dot product of two vectors measure, and what does it mean when the dot product is zero? What is for and ?
Next in Linear algebra and optimisation: What is the gradient of a function of two variables, and what does it tell you? What is the gradient of at the point ?