Linear Algebra: Operations on vectors

Chris Catalfo bio photo By Chris Catalfo Comment

Last time

If you didn’t read the first post, you might want to read that first.

So, we have vectors

Lists of things. What can we do with lists of things?

If the elements of the lists are addable we could try adding them.

What would it mean to add 2 lists of numbers?

Suppose we have two lists, call them listA and listB:

listA = [1,2,3,4]
listB = [10,11,12,13]

What should, in the context of Linear Algebra, adding these two lists mean?

listA + listB

If these were regular Python lists, or likely lists in any programming language, we’d probably get the concatenation of the two lists, like this:

listA + listB = [1,2,3,4,10,11,12,13]

In Linear Algebra, however, we were talking about adding the numbers. So what would that mean?

We could add some permutation of the numbers to eachother. Maybe the 1st element gets added to the 4th and then the 2nd and 3rd elements get added.

That would be like this:

listA + listB = [1+13,2+12,3+11,4+10] = [14,14,14,14]

That seems … odd, though, doesn’t it? And hard to remember.

Also one would think that corresponding elements in the two vectors would have some relationship to one another. Maybe they’re the distance from the x-axis. Or maybe they’re both the height in centimeters of a certain book.

If corresponding elements have a relationship it seems like it would make sense to add them.

Using that rule then, we’d have:

listA + listB = [1+10,2+11,3+12,4+13] = [11,13,15,17]

If we want to write that in a more mathematical style, we could write:

Usually we like to give a general rule for an algorithm like this.

For two vectors with elements and , the element of the resulting vector is given by:

That’s all for now. Next time: more operations we can perform on vectors.