You already have an understanding of the notion of vectors and why they are very useful. But sometimes we need to perform some operations on them. Imagine we have real numbers that indicate the distance between cities. But we are not interested in knowing just that, we want to calculate, for example, the shortest route. To do that, we will need arithmetic operations. Same with vectors: they are interesting when we can use them for something practical. Usually, we get new vectors after applying vector operations. This fact is crucial not only for fundamental areas of mathematics like linear algebra or calculus but also for modern areas of computer science like machine learning, video game development, and graphic design!
Vector operations
Like real numbers, vectors have main operations such as addition and multiplication, with subtraction and division as their respective inverses. Let's delve into these vector operations in detail.
Addition
In order to add two vectors, you first need to make sure they have an "equal size", that is, the number of elements. Remember, if vectors are of different sizes, they cannot be added together. So, to add two vectors, you just need to sum their respective elements. For example: assuming we have two equal-sized vectors and .
Now, add them together and you get the new vector :
As you can see, it's all quite simple! And just like addition, subtraction of vectors goes the same way, since subtraction is just the addition with the minus sign.
Multiplication by a scalar
This operation is even simpler. To multiply a vector by a scalar, just multiply every vector element by that value. Let's take a vector and multiply it by a scalar :
Pay attention to interesting special cases of multiplication by a scalar:
-
If you multiply any vector by , it will turn into a null vector:
-
If you multiply a null vector by any scalar, it will remain a null vector:
You might want to ask where is vector multiplication? Don't worry, it does exist, but it will be discussed later.
Combining vector operations
Those operations follow the same pattern as operations for numbers, that we are so used to. For instance, let's say you have three vectors
You want to calculate the following:
.
Well then, let's do it:
Geometric interpretation of operations
Let's talk a little bit about the geometry behind vector operations.
Addition
As we've discussed, the result of adding two vectors and be is a vector. But how to draw this vector? Well, the triangle and parallelogram laws are here to help you!
The triangle law is usually used, if the first vector's head joins the tail of the second vector . The resultant vector connects the tail of to the head of .
The parallelogram law is usually used if the tails of the vectors coincide. In this case, they form the two adjacent sides of a parallelogram. Since opposite sides of any parallelogram are parallel, you should draw a vector parallel to whose tail joins the head of and a vector parallel to whose tail joins the head of in order to complete this parallelogram. These vectors are shown as dashed lines in the picture. The result of the addition of and is the diagonal of our parallelogram through their common point!
Multiplication by a scalar
When a vector is multiplied by a scalar , you also get a vector . This vector will have the same direction as if is positive and the opposite direction of if is negative. For instance, we have that we want to multiply by the scalar and by the scalar . As a result, we get and :
Properties of vector operations
As far as properties resulting from the discussed operations are concerned, let's point out the three main ones.
Commutativity of addition. This one is simple: it doesn't matter in what order to add vectors. That means . It's easy to check too: we add the corresponding coordinates as numbers and don't care in what order we do that operation.
Associativity of addition. The property is related to the order of parentheses. The main idea is that during the addition of more than vectors, it's not important how parentheses are arranged, that is . It is also easy to check if you just calculate the expression. You can also easily prove it using the triangle law. At first, focus on the left side of the statement. When you add to using the triangle law, you get the yellow vector . After that, apply the triangle law once more to add this vector to and you'll get the black vector . Nearly the same thing is done according to the right side of the statement. You add to and get the yellow vector and afterward, you add to this vector. Once again, you get the black vector !
Distributivity of scalar multiplication over addition. The property shows us the rule for opening the parentheses during scalar multiplication. The rule goes as follows: . To verify it, you only need to calculate values on both ends of the equation and see that they are the exact same ones. Here's also a geometric proof of this property:
Conclusion
You learned how to add vectors and how to multiply them by a scalar. Most other operations are built around the first two in some way. You also learned about their importance, since without them, it wouldn't really be possible to do anything but look at the vectors. And now it's time to test how well you understood the topic and exercise a bit.