We often need to work with matrices. For example, you take a look at the monthly sales table and decide to find out how many items were sold during the last five years. Here's another example: you multiply the table with the number of office supplies by the number of offices to find out how much stuff you have to buy for the whole company. For all these tasks, we need to be able to perform different operations on matrices.
Today we will learn how to multiply a matrix by a scalar, add and subtract matrices, and finally, what a transposed matrix is.
Scalar multiplication
We can multiply a matrix by any number. Because this number scales the matrix, we call it a scalar, so officially it's called "scalar multiplication". To multiply a matrix by a scalar, you need to multiply each element of the matrix by that scalar.
We use scalar multiplication to simplify the matrix for solving a system of equations.
Matrix sum
If you need to add two matrices, they must be of the same dimension (or size). That means that they must have an equal number of rows, and also an equal number of columns.
For example, each of these matrices has two rows and three columns, so we can add them. To add two matrices, simply add the numbers in the matching positions:
Matrix difference
In order to subtract two matrices, make sure they are the same dimension, just like in case of an addition.
To subtract two matrices, simply subtract the numbers in matching positions:
As you probably noticed, the operations of addition and subtraction are very similar. Remember that subtracting one positive number from another is the same as adding a negative number. If we calculate , this rule also applies to matrices, where:
Transposed matrix
Starting with a matrix , you can get a new matrix by reflecting the elements of about its main diagonal so that rows become columns, and columns become rows. The superscript stands here for transpose. The relation between the elements of and the elements of is given by
For example, let's transpose this matrix:
When you transpose it, you should reflect its element about its main diagonal. So, at first, you have to understand what the main diagonal of is. The main diagonal starts in the top-left corner and ends at the element as shown by the blue color:
Elements on the main diagonal won't change, so you should work with all other elements. and it becomes after transposition. in the original matrix, and it becomes after transposition. So, you already know elements of the . Let's write them down! Here, blue elements are the elements on the main diagonal:
Let's move on to the . After transposition, it becomes , so in order to write in the you have to add a new column to the matrix, which you've obtained before:
What about the empty space in this matrix? and it becomes after transposition. You'll have instead of the empty space in the .
So, the result is
Repeating the process on the transposed matrix returns the elements to their original positions.
Conclusion
In this topic we've learned the main operations with matrices: how to add and subtract them or multiply by a scalar, and what the transpose of a matrix is. We will later need all this knowledge for our further studies, and, believe me, there will be a lot of interesting stuff!