<< 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 is the magnitude of component x i . There is also the sup-norm , the “supremum” or maximum of the components :
The following examples illustrate what the Euclidean norm, the l-norm, and the sup-norm look like for typical vectors.
Consider the vector . Then
Figure 1 shows the locus of two-component vectors with the property that , or
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 (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 at the intersection of Avenue-2 and Street 1? According to the Euclidean norm, the distance is
While it is true that point is blocks from , 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 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 and . Put the result in variable . Then find the angle by typing
The angle is in radians. You may convert it to degrees if you wish by multiplying it by :
Notification Switch
Would you like to follow the 'A first course in electrical and computer engineering' conversation and receive update notifications?