Are 'lists' and vectors the same thing?

  • Thread starter autodidude
  • Start date
  • Tags
    Vectors
In summary, the author of 'Linear Algebra Done Right' uses the term "list" to refer to an ordered sequence of elements. While this may seem similar to a vector, there are key differences, such as the ability to add and multiply vectors in an algebraic structure. The author may have chosen this terminology to convey the idea of an n-tuple more effectively.
  • #1
autodidude
333
0
I've just been reading through the first few pages of 'Linear Algebra Done Right' by S. Axler and so far, the concept of a 'list' seems a lot like a vector. Are they one and the same?

If so, is there a reason why Axler chose to call it a list? Perhaps maybe to rid the idea that a vector is a 'directed line segment'?

Thanks
 
Mathematics news on Phys.org
  • #2
I don't have that book so cannot see exactly how he defines "list" but, at least according to any definition I would consider reasonable, no, they are not the same. I would take a "list" to be an ordered sequence. I can, have, for example, my grocery list: bread, milk, tuna fish, green beans, potatoes. That is pretty much equivalent to the "list" data type you will find in Pascal, C++ or Java.

Now, while there are many different, more or less equivalent, ways to define "vector", they all give an algebraic structure. We must be able to add two vectors and multiply a vector by a number (or, more generally, an element of a field). That is certainly NOT the case for the "list" above.

If he is saying "a list of numbers with defined addition and scalar multiplication", that would be the same but I can see no good reason for the non-standard terminology.
 
  • #3
autodidude said:
I've just been reading through the first few pages of 'Linear Algebra Done Right' by S. Axler and so far, the concept of a 'list' seems a lot like a vector. Are they one and the same?
No. He says so himself: In general, a vector space is an abstract entity whose elements might be lists, functions, or weird objects.


If so, is there a reason why Axler chose to call it a list? Perhaps maybe to rid the idea that a vector is a 'directed line segment'?
However you learn abstract linear algebra, that a vector is a 'directed line segment' is one of the first notions you have to get rid of.
 
  • #4
autodidude said:
I've just been reading through the first few pages of 'Linear Algebra Done Right' by S. Axler and so far, the concept of a 'list' seems a lot like a vector. Are they one and the same?
No. A list's components need not necessarily be objects that obey the rules that define a vector (see page 9). For example, a list of positive integers has no additive inverse, ie there is no positive number w such that (v) + (w) = (0), whereas a vector does have an additive inverse.

If so, is there a reason why Axler chose to call it a list? Perhaps maybe to rid the idea that a vector is a 'directed line segment'?
Perhaps, although he does mention the traditional concept of an arrow as a vector on page 6 ("when we think of x as an arrow, we refer to it as a vector") so I think not. I think it's more likely to be because it conveys the idea of an n-tuple (see the side note on page 4) better than "n-tuple" does.

(Thank goodness for "Look Inside" on Amazon! :approve:)
 
  • #5
As I recall, he uses lists to group objects much as you would do with a set, but with two differences: first, the order in which the elements appear is significant, so (1,2) is not the same as (2,1); and second, there can be repetitions, so you can have a list like (2,2) which is distinct from (2), something you can't do with sets.
 
  • #6
Makes sense now, thanks a lot of everyone!
 

1. What is a list in programming?

A list is an ordered collection of items that can be of any data type, such as numbers, strings, or even other lists. It allows for storing and accessing multiple values using a single variable name.

2. What is a vector in programming?

A vector is a one-dimensional array that can hold a fixed number of values of the same data type. It is similar to a list, but each element has a specific index and can be accessed directly using that index.

3. Are lists and vectors the same thing in programming?

No, lists and vectors are not the same thing. While they both can store multiple values, lists can hold any data type and have no fixed size, whereas vectors are limited to a specific data type and size.

4. Can a list be converted into a vector?

Yes, it is possible to convert a list into a vector by using a built-in function or method provided by the programming language. However, the resulting vector may not retain the same data types as the original list.

5. When should I use a list or a vector in my code?

The choice between using a list or a vector depends on the specific needs of your program. If you need to store different data types or have a flexible size, a list would be more suitable. If you have a fixed number of values of the same type, a vector would be a better option.

Similar threads

Replies
6
Views
1K
  • Calculus and Beyond Homework Help
Replies
0
Views
419
Replies
10
Views
2K
  • General Math
Replies
1
Views
959
Replies
4
Views
2K
  • Calculus and Beyond Homework Help
Replies
8
Views
559
Replies
14
Views
1K
  • STEM Academic Advising
Replies
8
Views
716
  • Mechanics
Replies
4
Views
600
Replies
1
Views
985
Back
Top