Linear Algebra Crash Course 2— Vector Algebra

Number Basher
4 min readAug 23, 2022

--

Last time, we talked about what a vector is. This time, we will explore the two basic operations done with vectors: addition and scalar multiplication.

We can add two vectors. There are two ways to think about this: using arrows or using matrices. Let’s start with arrows.

Using arrows, you can connect one of them to the other, that is, the ending point of the first vector is the starting point of the second. This rule can be referred to as “the parallelogram rule,” due to this:

The same can be done with multiple vectors. This is referred to as “the polygon rule:”

Note the direction the sum of the vectors is pointing to.

Now, let us look at the matrix side of things. What if we represented the sum of two vectors in matrices?

I hope you see a pattern. We simply add all the entries of the vectors, one by one, and join the values into a new matrix.

Note that “4 - 1” is just a shorthand for “4 + (-1).” Generally:

More generally:

Ahh, beautiful!!!

The same can be applied to any dimension. In fact, this has a name in the field of computer science: if an operation is equivalent to doing that operation to all individual elements, we say that this operation “vectorize.” Thus, we can say that (vector) addition vectorize.

Scalar multiplication also vectorize. But first, what is a scalar? Remember the last lesson when we talked about what is a vector? A scalar is a value (without direction.) In mathematics, scalars are numbers. In programming, scalars can be characters, booleans, integers, or any individual. When we talk about scalar multiplication with vectors, we mean a scalar times a vector. But first, what is a scalar times a scalar? Well, this is your normal arithmetic. So it would be easy to infer that:

Notice the essence of vectorization.

But why does scalar multiplication vectorize? One reason is that the second equation is the same as the first one, only that all of the vectors are the same. The other way is to lie back on the other representation of vectors: arrows.

This is a great intuition, right? If your teacher asks you to put twice the force onto a wall, you still face the same direction, but you go twice the effort, right? (Yes, force is a common place where you use vectors.)

But what about negative scalars? How do you multiply a vector by -1? It turns out you reverse the direction. Had it been -0.5, you would have reversed the direction and decrease the length.

This seems correct. You would expect that for any vector,

Notice how “0” is a vector. It represents the vector 0, 0.

We defined subtraction on the fly, too! Here is an exercise left to the reader:

Interested? Go to my profile and watch the next episode!

--

--

Number Basher

Number Basher, math ethusiast and programmer. Cannot think of how to end Bio. Decides that the best place to end such Bio is abruptly in the middle of a sentenc