6.42.1 Norms of a vector: maxnorm l1norm l2norm norm
There are different norms for vectors in ℝn, and
Xcas has different commands for them.
Given a list L=[a1,…,an],
-
maxnorm(L) returns the
l∞ norm of L, namely
max(|a1|,|a2|,…,|an|)
Example.
Input:
maxnorm([3,-4,2])
Output:
Indeed, 4=max(|3|,|−4|,|2|).
- l1norm(L) returns the l1 norm of L,
namely |a1|+|a2|+⋯+|an|.
coordinates.
Example.
Input:
l1norm([3,-4,2])
Output:
Indeed, 9=|3|+|−4|+|2|.
- norm(L) or
l2norm(L) returns the
ℓ2 norm of L; namely
√|a1|2+|a2|2+⋯+|an|2.
Example.
Input:
norm([3,-4,2])
Output:
Indeed, 29=|3|2+|−4|2+|2|2.