# What is the difference between an array and a vector?

Okay so I'm doing a little bit of vector calculus at university (mainly with neural networks and the k-means clustering for cluster analysis in a 3 dimensional field or hyperplane)

And from what I understand

(Forgive me I'm not sure how to format the equation with mathJax)

Is all about weights * inputs

sumof(sizeof(w) * sizeof(x)) or sumof(|w| * |x|)


Okay so the question is based on this definition:

Maths

a quantity possessing both magnitude and direction, represented by an arrow the direction of which indicates the direction of the quantity and the length of which is proportional to the magnitude. Compare scalar (def. 4).

Computers

Computers. an array of data ordered such that individual items can be located with a single index or subscript.

So I know what a 2D array (matrix) in nmpy (python) is... (Is a vector represented differently? in the form of an array?)

x = [[1,2,3],[1,2,3]]


And I understand a vector is.

Whats the differences between an array that can be a vector? because a array can be many things like a matrices (from my perspective they all seem, like similar data structures)

Thanks

-

Actually in mathematics, vectors are elements of a vector space, that is members of a set $V$ on which an operation "vector addition" $+:V\times V\to V$ and an operation "multiplication with scalar" $\cdot: K\times V\to V$ with $K$ some field are defined, so that $(V,+)$ is an abelian group and there is associativity with the multiplication in $K$ and distributivity for both the addition in $K$ and the addition in $V$.

Or in short: You can add two vectors, and you can multiply a vector with a number (or something which behaves like numbers in certain respect).

Now where does the magnitude get in? To define a magnitude, we need an extra structure: a norm $\|\cdot\|:V\to \mathbb R_0^+$, whose job it is exactly to assign to each vector a magnitude.

Now if the field $K$ of the vector space contains the real numbers (this is not necessary for the existence of the norm; for example, the vector space could be over the rational numbers), then you can define the concept of direction to be represented be the unit vector $n_v=\frac{v}{\|v\|}$. Thus you can decompose each vector $v$ uniquely into a magnitude $\|v\|$ and a direction $d_v$ so that $v=\|v\|d_v$.

Now, one property of vector spaces (all of them, not only normed ones) is that they allow the definition of a basis, that is, a set of linearly independent vectors (vectors whose multiples don't add to the null vector unless all coefficients are $0$) so that you can write each vector as linear combination of basis vectors (that is, a sum of the form $\alpha_1 b_1+\dots+\alpha_n b_n$). Those $\alpha_i$ are unique for the vector. That is, you can describe the vector by the list of $\alpha_i$.

Now if the vector space is finite dimensional (that is, has a basis with finitely many basis vectors; the number of basis vectors is called the dimension), you have a list of finitely many numbers describing each vectors. That is, your vectors are described by a tuple of values. Now in computers, tuples of values are represented by arrays.

So ultimately, we have:

• All vectors in a normed vector space can be represented by magnitude and direction.
• All vectors in a finite dimensional vector space can (after a basis has been chosen) be represented by the values stored in an array.

The 3D Euclidean vector space which models our space of experience has both properties (and even more: it has a scalar product, so it also allows to define angles).

-
Wow! thanks! :D brilliant – Killrawr Sep 24 '12 at 7:33

An array of numbers is a means to represent a vector, given a basis of the vector space. Mental laziness often causes us to forget the distinction between the object designated en the entity used to represent it.

-
@Killrawr: What is a graph of length $N$? – Rod Carvalho Sep 24 '12 at 7:05
Thanks Marc :) By the way, how is the arrow represented in the form of an array? – Killrawr Sep 24 '12 at 7:13