<< Chapter < Page | Chapter >> Page > |
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
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}$ :
The following examples illustrate what the Euclidean norm, the l-norm, and the sup-norm look like for typical vectors.
Consider the vector $x=-3l2$ . Then
Figure 1 shows the locus of two-component vectors $x={x}_{1}{x}_{2}$ with the property that $\left|\right|x\left|\right|={1,\left|\right|x\left|\right|}_{1}=1$ , or ${\left|\right|x\left|\right|}_{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 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
and the l-norm
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
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. Theappropriate norm is the l-norm:
Even more generally, we can define a norm for each value of $p$ from 1 to infinity. The so-called p-norm is
DEMO 4.1 (MATLAB). From the command level of MATLAB, type the following lines:
Check to see whether the answer agrees with the definition of vector subtraction. Now type
Check the answer to see whether it agrees with the definition of scalar multiplication. Now type
This is how MATLAB does the inner product. Check the result. Type
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 $\theta $ by typing
The angle $\theta $ is in radians. You may convert it to degrees if you wish by multiplying it by $180/\pi $ :
Notification Switch
Would you like to follow the 'A first course in electrical and computer engineering' conversation and receive update notifications?