This module is part of the collection, A First Course in Electrical and Computer Engineering. The LaTeX source files for this collection were created using an optical character recognition technology, and because of this process there may be more errors than usual. Please contact us if you discover any errors.
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
|
)
,
|
|
x
|
|
1
=
(
|
x
1
|
+
|
x
2
|
+
⋯
+
|
x
n
|
)
,
(1)where |xi||xi|
is the magnitude of component xi. There is also the sup-norm, the
“supremum” or maximum of the components x1,...,xnx1,...,xn :
||x||sup=max(|x1|,|x2|,...,|xn|).||x||sup=max(|x1|,|x2|,...,|xn|).
(2)The following examples illustrate what the Euclidean norm, the l-norm, and
the sup-norm look like for typical vectors.
Consider the vector x=-3l2x=-3l2. Then
- ||x||=[(-3)2+(1)2+(2)2]1/2=(14)1/2||x||=[(-3)2+(1)2+(2)2]1/2=(14)1/2 ;
- ||x||1=(|-3|+|1|+|2|)=6||x||1=(|-3|+|1|+|2|)=6; and
- ||x||sup=max(|-3|,|1|,|2|)=3.||x||sup=max(|-3|,|1|,|2|)=3.
Figure 1 shows the locus of two-component vectors
x=x1x2x=x1x2 with the property that ||x||=1,||x||1=1||x||=1,||x||1=1, or ||x||sup=1.||x||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-2 (point A) is clearly two blocks from the center of town (point C). This is consistent with both the Euclidean norm
|
|
A
|
|
=
0
2
+
(
-
2
)
2
=
4
=
2
|
|
A
|
|
=
0
2
+
(
-
2
)
2
=
4
=
2
(3)and the l-norm
|
|
A
|
|
1
=
(
|
0
|
+
|
-
2
|
)
=
2
.
|
|
A
|
|
1
=
(
|
0
|
+
|
-
2
|
)
=
2
.
(4)But how far from the center of town is point
B
B at the intersection of Avenue-2
and Street 1? According to the Euclidean norm, the distance is
|
|
B
|
|
=
(
-
2
)
2
+
(
1
)
2
=
5
.
|
|
B
|
|
=
(
-
2
)
2
+
(
1
)
2
=
5
.
(5)While it is true that point
B
B is 55 blocks from
C
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
.
|
1
B
|
|
1
=
(
|
-
2
|
+
|
1
|
)
=
3
.
(6)
Even more generally, we can define a norm for each value of
p
p from 1
to infinity. The so-called p-norm is
|
I
x
|
|
p
=
(
|
x
1
|
p
+
|
x
2
|
p
+
⋯
+
|
x
n
|
p
)
1
/
p
.
|
I
x
|
|
p
=
(
|
x
1
|
p
+
|
x
2
|
p
+
⋯
+
|
x
n
|
p
)
1
/
p
.
(7)
Show that the Euclidean norm is the same as the p-norm with
p=2p=2 and that the 1-norm is the p-norm with p=1p=1. (It can also be shown
that the sup-norm is like a p-norm with p=∞.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
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
>> 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
x and
y
y. Put the result in variable
t
t. Then find the angle
θ
θ by typing
The angle
θ
θ is in radians. You may convert it to degrees if you wish by multiplying it by 180/π180/π:
>> theta = theta * (180/pi)
"Reviewer's Comments: 'I recommend this book as a "required primary textbook." This text attempts to lower the barriers for students that take courses such as Principles of Electrical Engineering, […]"