We've updated our

TEXT

# Examples: Using Technology to Perform Matrix Operations

## Calculator Clinic

Multiplying a matrix by a scalar:
1. Access the matrix features in the calculator by pressing . You should see something like the image below. Observe that each letter represents a matrix name. You may or may not see dimensions beside each matrix name. If you do, this simply means that the matrices have been defined by either you or someone else previously using your calculator. If you do not see any dimensions, then this simply means that no matrices have been defined yet.
2. Scroll over to EDIT. Select any of the matrices listed by pressing ENTER.
3. Specify the size of the matrix by first typing in the number of rows, then ENTER, and then the number of columns. You should see the entries highlighted as you enter them in. Notice the size here is 2x3
4. Begin entering the entries of the matrix. As you input an entry and hit ENTER, the cursor will advance to the next column, within the same row. Your entries are automatically saved.
5. We can now access the matrix from our home screen to perform operations on it. To do this, press to access the matrix window. We do not want to edit a matrix, so we will not scroll over to the EDIT column. Select the matrix you want to perform operations on and press ENTER. Matrix is now in the home screen 1
6. You can now press the multiplication sign followed by the scalar you wish to multiply it by. Depending on how your rounding is set, you might need to scroll to the right to see all additional matrix entries.
NOTE: You can either enter the scalar after the matrix or before the matrix. Just as with real numbers, order of multiplication of scalars does not matter.

### Example 1

Suppose Verizon faces increases in cost in the coming years. To adjust it decides to increase its plan prices by 2%. Find the new pricing matrix for Talk and Talk & Text plans.

#### Solution

Mathematically, the price after a 2% increase requires us to multiply by 1.02 (recall that we need to get the 2% increase, as well as the original 100% of the price). Since we wish for all plans to go up by 2% in price, we multiply the matrix by 1.02: [latex-display]\displaystyle{1.02}{\left[\matrix{{39.99}&{59.99}&{69.99}\{59.99}&{79.99}&{89.99}}]}={\left[\matrix{{({1.02})}{39.99}&{({1.02})}{59.99}&{({1.02})}{69.99}\{({1.02})}{59.99}&{({1.02})}{79.99}&{({1.02})}{89.99}}]}={\left[\matrix{{40.79}&{61.19}&{71.39}\{61.19}&{81.59}&{91.79}}]}[/latex-display] The new costs for Verizon's new plan are given above.

### Example 2

As you probably know, stated monthly rates are not all that are paid each month; you are required to pay a number of different taxes and fees. Suppose that the following fees are in place for each of the plans:
 450 900 Unlimited Talk $1.50$1.75 $2.10 Talk/Text$1.60 $1.84$1.99
Write the table as a matrix and explain how you might combine it with matrix to get prices including fees.

#### Solution

The fee matrix will be: [latex-display]\displaystyle{F}={\left[\matrix{{1.50}&{1.75}&{2.10}\{1.60}&{1.84}&{1.99}}]}[/latex-display] To get the price matrix with fees, we would need to add each plan fee to the corresponding plan price. In other words, we write [latex-display]\displaystyle{V}+{F}={\left[\matrix{{39.99}&{59.99}&{69.99}\{59.99}&{79.99}&{89.99}}]}+{\left[\matrix{{1.50}&{1.75}&{2.10}\{1.60}&{1.84}&{1.99}}]}[/latex-display] [latex-display]\displaystyle={\left[\matrix{{39.99}+{1.50}&{59.99}+{1.75}&{69.99}+{2.10}\{59.99}+{1.60}&{79.99}+{1.84}&{89.99}+{1.99}}]}[/latex-display] [latex-display]\displaystyle={\left[\matrix{{41.49}&{61.74}&{72.09}\{61.59}&{81.83}&{91.98}}]}[/latex-display]

### Example 3

The following matrix represents crude oil imports into the U.S. in millions of barrels from Iraq, Nigeria, and Saudi Arabia (rows) for years 2008 and 2009 (columns). (source: U.S. Statistical Abstract, Table 932) Do the following:
1. Write an import matrix representing 2009 oil imports alone for each of the three countries.
2. Create a 3 x 1 matrix that represents millions of barrels per year between 2008 and 2009. Explain the real-world meaning of your answer.
3. Assuming oil imports increase at a constant rate of change from 2009 to 2011 and that it is expected that all three countries decrease their exports by 3%, find the total oil imports into the U.S. for 2011. Do this two different ways. Explain the difference and establish a "rule" about combining matrices.

#### Solutions

1. This is simply the second column of the given matrix: $\displaystyle{\left[\matrix{{164}\{281}\{361}}]}$
2. We want to find the difference from the first column (2008) to the second column (2009): [latex-display]\displaystyle{\left[\matrix{{164}\{281}\{361}}]}-{\left[\matrix{{229}\{338}\{551}}]}={\left[\matrix{-{65}\-{57}\-{190}}]}[/latex-display] We conclude that the import of oil to the U.S. from Iraq, Nigeria, and Saudi Arabia decreased considerably. Most notably, oil import from Saudi Arabia decreased by 190 million barrels in one year.
3. One way we can approach this is to add the rate of change matrix to the 2009 matrix twice to get to our estimates for 2011. We can then multiply the 2011 matrix by .97, since we are assuming that exports will decrease by 3% (3% below 100% is 97%). [latex-display]\displaystyle{\left[\matrix{{164}\{281}\{361}}]}+{2}{\left[\matrix{-{65}\-{57}\-{190}}]}={\left[\matrix{{34}\{167}\-{19}}]}[/latex-display] In other words, we took: [latex-display]\displaystyle{.97}{({\left[\matrix{{164}\{281}\{361}}]}+{2}{\left[\matrix{-{65}\-{57}\-{190}}]})}={\left[\matrix{{33}\{162}\-{18}}]}[/latex-display] That is, we find that the U.S. will receive approximately 33 million barrels of oil from Iraq, 162 million barrels from Nigeria, and no oil from Saudi Arabia (since we cannot receive negative barrels) Thinking back to some algebraic rules, could we also multiply each of the two terms by .97, and then add to get the same answer? [latex-display]\displaystyle{.97}{\left[\matrix{{164}\{281}\{361}}]}={\left[\matrix{{159}\{273}\{350}}]}[/latex-display] Combining these resulting matrices gives: [latex-display]\displaystyle{\left[\matrix{{159}\{273}\{350}}]}+{\left[\matrix{-{126}\-{111}\-{369}}]}={\left[\matrix{{33}\{162}\-{18}}]}[/latex-display] which is precisely what we found with the first approach.

### Example 4

If possible, give the dimensions of the product of the matrices below. If not possible, explain why. Do not actually multiply them. [latex-display]\displaystyle{A}={\left[\matrix{{1}&{3}\{7}&{4}\{5}&{5}}]} {B}={\left[\matrix{{2}&{1}&{1}\{5}&{4}&{2}}]} {C}={\left[\matrix{{1}&{8}&{7}\{2}&{6}&{7}\{0}&{0}&{2}}]}[/latex-display]
1. AB
2. CA
3. BC
4. CB

#### Solutions

1. Since the dimensions are: the matrices can be multiplied, and will result in a matrix.
2. Since the dimensions are: the matrices can be multiplied, and will result in a matrix.
3. Since the dimensions are: the matrices can be multiplied, and will result in a matrix.
4. Since the dimensions are: the matrices cannot be multiplied. Why not? Well, if we simply try to find the 1-1 entry of a matrix that would represent the product, notice that we would get 1(2) + 8(5) + 7(???) Notice that there is not a value by which to multiply 7, since there are only two entries in column 1 of the second matrix. If this value should be 0, it needs to be specified as a value in the matrix (0 is not the same as nothing!). Recall that we encountered a similar situation when adding or subtracting matrices of different dimensions.

### Example 5

Companies purchasing from REI have requested to have the total sales tax given separately from the total cost. If the sales tax rate is 8%, use matrix multiplication to address the companies' requests.

#### Solution

We first need to know what the sales tax is for one instance of the order.
 Product/Amount Cost Tax Tent $185 .08($185) = $14.8 Sleeping Bag$130 .08($130) =$10.4 Backpack $85 .08($85) = $6.8 Modifying our matrix to include sales tax, Assuming the same two companies, we have the order matrix: [latex-display]\displaystyle{C}_{{{2}\cdot{3}}}={\left[\matrix{{stackrel{{\text{T}}}{{5}}}&{stackrel{{\text{SB}}}{{10}}}&{stackrel{{\text{BP}}}{{15}}}\{12}&{35}&{18}}]}{\left[\matrix{\text{Company 1 Order}\text{Company 2 Order}}.}[/latex-display] If you've observed that these matrices could be multiplied in either order, then you're correct; However, it certainly will not make sense both ways. Let's start first with the way we have been, that is, CP: [latex-display]\displaystyle{\left[\matrix{\text{Company 1 Order}\text{Company 2 Order}}.}{\left[\matrix{{stackrel{{\text{T}}}{{5}}}&{stackrel{{\text{SB}}}{{10}}}&{stackrel{{\text{BP}}}{{15}}}\{12}&{35}&{18}}]}{\left[\matrix{{stackrel{{\text{Cost}}}{{185}}}&{stackrel{{\text{Tax}}}{{14.8}}}\{130}&{10.4}\{85}&{6.8}}]}{\left[\matrix{\text{T}\text{SB}\text{BP}}.}[/latex-display] Notice that the product will be a 2 × 2 and that the inner dimensions are not only the same, but the inner dimensions represent the same quantity—this is very important and always necessary. Also, note the meaning of the rows of the first matrix and the meaning of the columns of the second matrix: This will be what our new matrix measures on the rows and columns, respectively. Why? Let's see: The product, then, is [latex-display]\displaystyle{\left[\matrix{{5}{({185})}+{10}{({130})}+{15}{({85})}&{5}{({14.8})}+{10}{({10.4})}+{15}{({6.8})}\{12}{({185})}+{35}{({130})}+{18}{({85})}&{12}{({14.8})}+{35}{({10.4})}+{18}{({6.8})}}]}={\left[\matrix{{3500}&{280}\{8300}&{664}}]}[/latex-display] Notice that the first column of the first row takes the number of tents, times the price of each tent, plus the number of sleeping bags times the price of each sleeping bag, plus the number of backpacks times the price of each backpack. This, still, represents the total cost, excluding taxes, to Company 1. What about the second column? Well, we still have the number of tents (5) times the sales tax for each tent, plus the number of sleeping bags times the sales tax for each sleeping bag, plus the number of backpacks times the sales tax for each backpack. This, then, represents the total sales tax paid by Company 1 for its order, which is$280. Similar logic holds for the second row, except that this data is specific to Company 2. It is now appropriate to write: [latex-display]\displaystyle{\left[\matrix{\text{Company 1 Order}\text{Company 2 Order}}.}{\left[\matrix{{stackrel{{\text{Cost}}}{{3500}}}&{stackrel{{\text{Tax}}}{{280}}}\{8300}&{664}}]}[/latex-display] To finally address why it is not valid to multiply PC, let's look at what would happen: We first see that the resulting matrix is a 3 × 3, which is a different dimension than the we obtained above. [latex-display]\displaystyle{\left[\matrix{\text{T}\text{SB}\text{BP}}.}{\left[\matrix{{stackrel{{\text{Cost}}}{{185}}}&{stackrel{{\text{Tax}}}{{14.8}}}\{130}&{10.4}\{85}&{6.8}}]}{\left[\matrix{{stackrel{{\text{T}}}{{5}}}&{stackrel{{\text{SB}}}{{10}}}&{stackrel{{\text{BP}}}{{15}}}\{12}&{35}&{18}}]}{\left[\matrix{\text{Company1 Order}\text{Company 2 Order}}.}[/latex-display]   Consider only the 1-1 entry of the resulting matrix: 185(5) + 14.8(12) What does this expression represent? Well, we are taking the cost of a tent and multiplying it by the number of tents Company 1 orders. Okay, this seems to jive. The second term is the sales tax for one tent times the number of tents Company 2 purchased. But, wait! Does it make sense to add up: Total tent cost for Company 1 + Total tent sales tax for Company 2 Not in the slightest. How do we prevent this? Simple: ensure that the columns of the first matrix represent the same quantity as the rows of the second matrix. In this situation, they don't, so we should not multiply them. Columns of first matrix do not match rows of second matrix
Milos Podmanik, By the Numbers, "Systems of Linear Equations," licensed under a CC BY-NC-SA 3.0 license.