How do you multiply two matrices?
The process of multiplying matrices is different from scalar multiplication or the other matrix operations in the previous section. Instead of multiplying corresponding entries, in matrix multiplication we multiply the rows in one matrix by the columns in another matrix. This process can be demonstrated by multiplying a row matrix times a column matrix. Suppose we have a 1 x k matrix,
and a k x 1 matrix,
In each matrix, the dots help to indicate the arbitrary number of rows or columns in each matrix. Although this number k is arbitrary, the number of columns in A must match the number of rows in B. Otherwise it is not possible to carry out the multiplication process.
To find the product these matrices, we must multiply the entries in the row matrix by the entries in the column matrix and add the resulting products:
Notice that each product comes from corresponding columns and rows. In other words, the first product is formed from the first column in the first matrix and the first row in the second matrix, the second product is formed from the second column in the first matrix and the second column in the second matrix, and so on.
Let’s try the following product:
To help identify the factors in the products, let’s color code each corresponding factor and carry out the sum:
The key to carrying out the process is to correspond the factors in each product correctly.
This process is carried out several times when matrices with more than one row or column are multiplied. However, the number of columns in the first matrix must match the number of rows in the second matrix.
How to Multiply Two Matrices
- Make sure the number of columns in the first matrix matches the number of rows in the second column. If they do not match, the product is not possible.
- The size of the products is the number of rows in the first matrix by the number of columns in the second matrix. The product of m x k matrix and a k x n matrix is an m x n matrix. Form a matrix of the proper size with blank spaces for each entry.
- For each entry in the product, form the corresponding factors and sums. The entry in the ith row and jth column of the product is found by corresponding and multiplying the ith row in the first matrix with the jth column in the second matrix.
Example 1 Multiply Two Matrices
Let
Find the products indicated in each part.
a. AB
Solution To be able to compute this product, the number of columns in A must equal the number of rows in B. Since A has 3 columns and B has 2 rows,
it is not possible to compute this product.
b. BA
Solution For this product, the number of columns in B is equal to the number of row in A,
This means the product can be computed. The size of the resulting product is determined by the number of rows in B, 2, and the number of columns in A,3:
Now that the size of the product is known, we can find the entries in the product.
Start with blank entries in a 2 x 3 matrix:
We can find the value of any entry in the product by corresponding the proper row and column in the factors. For instance, the entry in the second row, first column is computed from the second row of the first matrix and the first column of the second matrix:
This entry is placed in the product matrix,
The entry in the first row, third column is computed from the first row of the first matrix and the third column of second column:
Adding this entry to the product matrix yields
We can compute the other four entries in the product matrix similarly.
Example 2 Multiply Two Matrices
The table below gives the number of expiring subscriptions for Ed Magazine.
This information is summarized in the matrix
The different categories of subscribers renew their subscriptions at different rates. Twenty five percent of the first time subscribers renew their subscriptions and fifty percent of the existing subscribers renew their subscriptions.
a. Use matrix multiplication to find a matrix describing the total number of renewed subscribers by quarter.
Solution To see how matrix multiplication can be used to calculate the total number of renewed subscribers, watch the video, let’s look at the quarter ending 3/31. In that quarter, 6000 first time subscribers and 15000 continuing subscribers have their subscriptions expiring. We know that 25% of the first time subscribers will renew and 50% of the continuing subscribers will renew.
The total number of renewed subscriptions in the first quarter is
We can also calculate the total number of renewed subscriptions in other quarters using this same strategy.
Notice that each number is the sum of two products. The product of two matrices creates a new matrix where each entry is a sum of products. This suggests that we define a matrix
of the renewal rates for the subscribers groups.
The product
can be carried out since E has 2 columns and P has 2 rows.
The resulting product is a 4 x 1 matrix:
Notice that each entry matches the totals found earlier. Using matrices we are able to compute the total number of renewals by quarter efficiently. Additionally, if more quarters are included in E the process can still be carried out by adding more rows to E.
b. A renewing subscriber pays $18 per year for a subscription. Find a matrix that gives the cash receipts from renewed subscriptions by quarter.
Solution The product EP gives the total number of renewed subscriptions by quarter. To find the cash receipts from these subscriptions, we must multiply each entry in the product by 18. Multiplying the product EP by the scalar 18 gives
c. The matrix
gives the cash receipts from new subscriptions by quarter. Find the matrix R that gives the total cash receipts from new and existing subscriptions.
Solution The total cash receipts R is the sum of cash receipts from new subscriptions R1 and cash receipts from existing subscriptions R2,
Combine R1 and R2 to yield