abs(x) = x if x>0, 0 if x=0, -1 if x<0
sgn(x) = 1 if x>0, 0 if x=0, -1 if x<0
In many kinds of vector space (in this case, a 3d vector space), the
"magnitude" and "normalize" operations are commonly defined as:
magnitude(v) = v.x^2 + v.y^2 + v.z^2
normalize(v) = v / (v.x^2 + v.y^2 + v.z^2) if v<>0, 0 otherwise
These operations obey the identities:
abs(x) = x*sgn(x)
sgn(x) = lim(y->x) y/abs(y)
magnitude(v) = v*normalize(v) (where * is the inner product
operation)
normalize(v) = lim(w->v) w/magnitude(w)
So, from a certain point of view these two sets of operations
represent the same notion: "absolute value" and "magnitude" represent
the directionless size of a number or vector, while "sign" and
"normalize" represent the sizeless direction of a number or vector.
QUESTION: Is there a name for or formalization of this generalized
notion of "size" and "direction"? And exactly what is the minimal set
of spaces upon which these operations are generally defined?
From my informal Google search on this topic, it sounds like the
"normed vector spaces" (http://mathworld.wolfram.com/NormedSpace.html)
are what I'm looking for. If this is the answer, then would it be
considered kosher to view the real numbers as a normed vector space
(over the real numbers themselves), where the norm is simply the
absolute value?
The context of the question is this: I'm writing a computer math
library, and am looking for the appropriate set of types over which
the sgn/abs/magnitude/normalize functions can be defined generally,
and am looking for an abstraction and nomenclature which will offend
the fewest people possible.
I presume you intended above: -x if x<0
> sgn(x) = 1 if x>0, 0 if x=0, -1 if x<0
>
> In many kinds of vector space (in this case, a 3d vector space), the
> "magnitude" and "normalize" operations are commonly defined as:
>
> magnitude(v) = v.x^2 + v.y^2 + v.z^2
> normalize(v) = v / (v.x^2 + v.y^2 + v.z^2) if v<>0, 0 otherwise
>
> These operations obey the identities:
>
> abs(x) = x*sgn(x)
> sgn(x) = lim(y->x) y/abs(y)
No. The above fails for x=0. Perhaps this is another typo. For example,
it is true that, for all real x,
sgn(x) = lim(y->x) x/abs(y).
Maybe that's what you intended.
The corresponding change should be made in the second statement below.
> magnitude(v) = v*normalize(v) (where * is the inner product operation)
> normalize(v) = lim(w->v) w/magnitude(w)
David Cantrell
Besides the typos that David Cantrell pointed out, you are making
things needlessly complicated. In R^n,
|(x_1,...x_n)| = sqrt(x_1^2 + ... + x_n^2). This is true even if n = 1.
If x =/= 0 is a vector the normalization of x is (1/|x|)x.
> On real numbers, the "abs" and "sgn" are commonly defined as:
>
> abs(x) = x if x>0, 0 if x=0, -1 if x<0
> sgn(x) = 1 if x>0, 0 if x=0, -1 if x<0
>
> In many kinds of vector space (in this case, a 3d vector space), the
> "magnitude" and "normalize" operations are commonly defined as:
>
> magnitude(v) = v.x^2 + v.y^2 + v.z^2
> normalize(v) = v / (v.x^2 + v.y^2 + v.z^2) if v<>0, 0 otherwise
>
> These operations obey the identities:
>
> abs(x) = x*sgn(x)
> sgn(x) = lim(y->x) y/abs(y)
>
> magnitude(v) = v*normalize(v) (where * is the inner product
> operation)
> normalize(v) = lim(w->v) w/magnitude(w)
>
> So, from a certain point of view these two sets of operations
> represent the same notion: "absolute value" and "magnitude" represent
> the directionless size of a number or vector, while "sign" and
> "normalize" represent the sizeless direction of a number or vector.
>
> QUESTION: Is there a name for or formalization of this generalized
> notion of "size" and "direction"? And exactly what is the minimal set
> of spaces upon which these operations are generally defined?
>
> From my informal Google search on this topic, it sounds like the
> "normed vector spaces" (http://mathworld.wolfram.com/NormedSpace.html)
> are what I'm looking for.
It seems so unless you insist on an inner (dot) product in which case
you need (guess what) an inner product space.
> If this is the answer, then would it be
> considered kosher to view the real numbers as a normed vector space
> (over the real numbers themselves), where the norm is simply the
> absolute value?
Perfectly OK. R is also an inner product space.
> The context of the question is this: I'm writing a computer math
> library, and am looking for the appropriate set of types over which
> the sgn/abs/magnitude/normalize functions can be defined generally,
> and am looking for an abstraction and nomenclature which will offend
> the fewest people possible.
I'm guessing more people are familiar with inner product spaces than
with normed linear spaces. If you don't want to use | |, I suggest
"norm" rather than "abs" or "magnitude". I don't know of any common
notation for (1/|x|)x.
--
Paul Sperry
Columbia, SC (USA)
> On real numbers, the "abs" and "sgn" are commonly defined as:
>
> abs(x) = x if x>0, 0 if x=0, -1 if x<0
> sgn(x) = 1 if x>0, 0 if x=0, -1 if x<0
>
> In many kinds of vector space (in this case, a 3d vector space), the
> "magnitude" and "normalize" operations are commonly defined as:
>
> magnitude(v) = v.x^2 + v.y^2 + v.z^2
> normalize(v) = v / (v.x^2 + v.y^2 + v.z^2) if v<>0, 0 otherwise
Well, the norm of x is more generally defined as the inner product of
the adjoint of x by x. That lets you handle elements that are complex
numbers.
norm(x) = inner-product(adjoint(x), x)
It's not sufficient to handle matrixes, though, since it leaves you
with a matrix again. Similarly other tensors of rank > 1. There are
several matrix norms at http://mathworld.wolfram.com that you may wish
to look at, if you intend to go that far.
One device you may want to keep in mind is that complex numbers can be
represented by 2x2 matrixes,
a + ib : [ a b ]
-b a
and it's easily seen that their complex conjugate is their transpose,
so you don't neccessarily need special rules to adjointize complex
numbers. This also provides some hint as to how matrix norms may fit
in the picture.
> These operations obey the identities:
>
> abs(x) = x*sgn(x)
This seems like it would give the wrong results.
abs(5i) = 5i * i = -5 ?
Perhaps
x = norm(x) * sign(x) ?
> sgn(x) = lim(y->x) y/abs(y)
What I see more often is to define it such that its norm = 1 and it's
parallel with the original vector. Parallel is defined as the
condition that the norm of the product equals the product of their
norms.
a = sign(b)
iff
norm(a) = 1,
norm(a * b) = norm(a) * norm(b)
> From my informal Google search on this topic, it sounds like the
> "normed vector spaces" (http://mathworld.wolfram.com/NormedSpace.html)
> are what I'm looking for. If this is the answer, then would it be
> considered kosher to view the real numbers as a normed vector space
> (over the real numbers themselves), where the norm is simply the
> absolute value?
Sounds reasonable to me. I have always thought of norms as
generalizations of absolute value.
> The context of the question is this: I'm writing a computer math
> library, and am looking for the appropriate set of types over which
> the sgn/abs/magnitude/normalize functions can be defined generally,
> and am looking for an abstraction and nomenclature which will offend
> the fewest people possible.
One comment: FWIW, generally one defines an orthonormal basis for a
vector space, which consists of the elementary "signs" an object can
have, and works in terms of that. Your way would be like defining a
unit vector for every vector, which mind you I think is rather cool.
--
Tom Breton at panix.com, username tehom. http://www.panix.com/~tehom