Choosing a programming language as a competitive tool
dalke at acm.org
Mon May 7 18:54:44 CEST 2001
>Isaac To Kar Keung <kkto at csis.hku.hk> writes:
>> Right, vector really has its mathematical meaning. If you can
>> understand that vectors are not meant to be just 2D or 3D vector,
>> you can understand why vector means an array. But of course, I
>> don't quite understand how a mathematical vector can be "resized".
>Well, without specifying a norm it's meaningless to talk about a
>vector's size anyway.
Isaac was refering to the dimensionality of a vector not its
> Presumably by projecting it onto a space of lower dimensionality, or
> embedding it into a space of higher dimensionality.
> E.g., say that originally you know that a vector is (2, 4) -- in 2
> dimensions, of course, as it has 2 components. Now, you learn that
> the 2-D space where that original vector lie is the plane Z=0 in
> 3-D space. Ok, so, to perform further operations using that vector
> in 3-D space, you "resize" it to (2, 4, 0).
That doesn't work because in Python (2, 4) is not equivalent to
(2, 4, 0). If you want to talk about its embedding in some sort
of vector space you'll need another, perhaps boolean space to
define which axes of the infinite space are used to define this
Also, if (x, y) really is a vector in a vector space then
'+' must be defined so (x1, y1) + (x2, y2) is also a vector
in the vector space and is commutable, so it equals
(x2, y2) + (x1, y1). This doesn't work if x1 and x2 are strings,
so Python lists/tuples really have nothing to do with vectors
in the math sense.
Also, addition of two lists/two tuples doesn't correspond to
any addition of vectors in a vector space.
dalke at acm.org
More information about the Python-list