4.6: Other Norms
Sometimes we find it useful to use a different definition of distance, corresponding to an alternate norm for vectors. For example, consider the l-norm defined as
\[||x||_1=(|x_1|+|x_2|+⋯+|x_n|) \nonumber \]
where \(|x_i|\) is the magnitude of component \(x_i\). There is also the sup-norm, the “supremum” or maximum of the components \(x_1,...,x_n\) :
\[||x||_{\mathrm{sup}}=\mathrm{max}(|x_1|,|x_2|,...,|x_n|) \nonumber \]
The following examples illustrate what the Euclidean norm, the l-norm, and the sup-norm look like for typical vectors
Consider the vector \(x=\begin{bmatrix} −3\\1\\2 \end{bmatrix}\). Then
- \(||x||=[(−3)^2+(1)^2+(2)^2]^{1/2}=(14)^{1/2}\)
- \(||x||_1=(|−3|+|1|+|2|)=6\)
- \(||x||_{\mathrm{sup}}=\mathrm{max}(|−3|,|1|,|2|)=3\)
Figure \(\PageIndex{1}\) shows the locus of two-component vectors \(x=\begin{bmatrix}x_1\\x_2\end{bmatrix}\) with the property that \(||x||=1\),\(||x||_1=1\), or \(||x||_{\mathrm{sup}}=1\).
The next example shows how the l-norm is an important part of city life.
The city of Metroville was laid out by mathematicians as shown in Figure \(\PageIndex{2}\) . A person at the intersection of Avenue 0 and Street −2 (point A) is clearly two blocks from the center of town (point C). This is consistent with both the Euclidean norm
\[||A||=\sqrt{0^2+(−2)^2}=\sqrt{4}=2 \nonumber \]
and the l-norm
\[||A||_1=(|0|+|−2|)=2 \nonumber \]
But how far from the center of town is point B at the intersection of Avenue-2 and Street 1? According to the Euclidean norm, the distance is
\[||B||=\sqrt{(−2)^2+(1)^2}=\sqrt{5} \nonumber \]
While it is true that point B is \(\sqrt{5}\) blocks from C , it is also clear that the trip would be three blocks by any of the three shortest routes on roads. The appropriate norm is the l-norm:
\[∣1^B||_1=(|−2|+|1|)=3 \nonumber \]
Even more generally, we can define a norm for each value of p from 1 to infinity. The so-called p-norm is
\[|Ix||_p=(|x_1∣∣^p+|x_2∣∣^p+⋯+|x_n|^p)^{1/p} \nonumber \]
Exercise \(\PageIndex{1}\)
Show that the Euclidean norm is the same as the p-norm with p=2 and that the 1-norm is the p-norm with p=1. (It can also be shown that the sup-norm is like a p-norm with p=∞.)
DEMO 4.1 (MATLAB)
From the command level of MATLAB, type the following lines:
>> x = [1;3;-2;4] >> y = [0;1;2;-0.5] >> x - y
Check to see whether the answer agrees with the definition of vector subtraction. Now type
>> a = -1.5 >> a * x
Check the answer to see whether it agrees with the definition of scalar multiplication. Now type
>> x' * y
This is how MATLAB does the inner product. Check the result. Type
>> norm(y) >> sqrt(y' * y)
>> norm(y,1) >> norm(y' * y)
Now type your own MATLAB expression to find the cosine of the angle between vectors x and y. Put the result in variable t. Then find the angle θ by typing
>> theta = acos(t)
The angle θ is in radians. You may convert it to degrees if you wish by multiplying it by \(180/π\):
>> theta = theta * (180/pi)