Vectors vs Sets
During your studies you might have stumbled upon sets.
Sets really are collections of objects, so what is the difference between a set and a vector if vectors also are some sort of “list”?
1. Order
Differently from sets, with vectors order matters.
If we have a set defined as
and a set defined
we can safely say that
This is because in sets, what matters is what elements are inside of it. We’re listing objects to represent some group of them.
If I want to define a set which is just “the set of all cars”, the order in which I list the cars doesn’t matter, all I care about is that the set contains all the cars.
With vectors, on the other hand, order does matter, since we are not trying to define some subset of something; we want to have some list of mathematical objects (these mathematical objects need to satisfy certain properties) in a specific order.
For example, the vector
is different from the vector
2. Repeated Elements
For similar reasons, it makes sense for vectors to allow duplicate elements.
Of course, defining a set writing the same element twice is not “wrong” per se, but it’s considered sloppy notation. That’s because specifying the same element twice is redundant in a set:
But in a vector, if we have a vector defined as
then the first component of the vector is , and the second is also .
The vector
would be a completely different vector, since the first one was a three-dimensional vector, and this one is two-dimensional.
3. Operations
Vectors and sets have very different operations which are defined for them.
You can add vectors (), but you can’t “add” sets. You can find the union of two sets, or the intersection, but that’s a different operation.
You can multiply vectors with scalar values, but you can’t do that with sets.
Conclusion
These are just some examples, of course there are other differences. But hopefully, this makes the distinction between these two mathematical tools clearer.