Consider the two-by-two matrices 𝐴 equals one, one, zero, zero and 𝐵 equals zero, one, zero, one. Is 𝐴𝐵 equal to 𝐵𝐴?
In this example, we want to determine the matrix multiplication of two two-by-two matrices in both directions. If 𝐴𝐵 equals 𝐵𝐴, then we can say that matrix multiplication is commutative in this case. We recall that in general matrix multiplication is not commutative. We also recall that matrix multiplication can only be performed in certain circumstances, depending on the order of each matrix.
Let’s say matrix 𝐴 had order 𝑚 by 𝑛 and matrix 𝐵 had order 𝑛 by 𝑝. This means that matrix 𝐴 has 𝑚 rows and 𝑛 columns and matrix 𝐵 has 𝑛 rows and 𝑝 columns. In order to perform matrix multiplication 𝐴𝐵, the number of columns in matrix 𝐴 must equal the number of rows in matrix 𝐵. On the other hand, to perform matrix multiplication 𝐵𝐴, the number of columns of matrix 𝐵 must equal the number of rows of matrix 𝐴. In other words, 𝑚 must equal 𝑝. In this example, both matrices have order two by two. So we will have no problem multiplying in either direction because the number of columns and the number of rows are all the same.
Let’s clear some space in order to do our first matrix multiplication. Let’s begin by finding 𝐴𝐵. Since 𝐴 is a two-by-two matrix and 𝐵 is a two-by-two matrix, 𝐴𝐵 will also be a two-by-two matrix. To demonstrate the process, let’s carry out the details of the multiplication for the first row. We take the first element of the first row of matrix 𝐴 and multiply it with the first element of the first column of matrix 𝐵, that is, one times zero. Then, we add the product of the second element from the first row of matrix 𝐴 with the second element of the first column of matrix 𝐵, that is, one times zero. Evaluating this expression gives us zero, which will be the first element of our product matrix.
To find the second element of the product, we will repeat these procedures with the first row of matrix 𝐴 and the second column of matrix 𝐵. This looks like one times one plus one times one, which equals two. Therefore, two is the second element of our product.
Now that we have found the entire first row of our product, we will move down to the second row of matrix 𝐴 and use those two entries for our final computations. We find the next entry of our product to be zero and the final entry to also be zero. Now we are ready to perform the matrix multiplication in the other order, 𝐵 times 𝐴. For consistency, we will continue to use pink to underline elements in matrix 𝐵 and orange to underline elements in matrix 𝐴.
Using the same procedures as before we find the first element of our product to be zero. The second element is also zero, and the third, and the fourth. If we examine the second element in the first row of each product, we see that two does not equal zero, meaning the two matrices are not equal. Therefore, our answer to this question is no, the matrix multiplication between these two specific matrices is not commutative because 𝐴𝐵 does not equal 𝐵𝐴.