Difference between revisions of "Matrix multiplication"
m |
m |
||
| Line 40: | Line 40: | ||
5 & 1 | 5 & 1 | ||
\end{bmatrix} </math> | \end{bmatrix} </math> | ||
| + | |||
System of linear equations | System of linear equations | ||
Revision as of 22:14, 27 November 2021
While matrix addition usually does not present motivational challenges (addition is defined in a straight-forward component-wise way), to introduce matrix multiplication it is desirable to explain why we do not use component-wise approach. Of course, the "most appropriate" way to explain the formula for matrix multiplication is via composition of linear transformation. However, matrices (and matrix operations) are usually introduced before the linear transformations, and, additionally, linear transformation require a higher level of abstraction. Below we present several alternative approaches.
We start with a simple example showing a practical use of multiplying a matrix by numbers (scalars). Below is an example of a distance matrix between three cities, in kilometers:
[math]\displaystyle{ A =\begin{bmatrix} 0 & 340 & 360 \\ 340 & 0 & 450 \\ 360 & 450 & 360 \end{bmatrix} }[/math]
We can multiply this matrix by [math]\displaystyle{ 0.62 }[/math] to (approximately) convert it to distances in miles:
[math]\displaystyle{ B =0.62\cdot A \begin{bmatrix} 0.62 \cdot 0 & 0.62\cdot 340 & 0.62 \cdot 360 \\ 0.62 \cdot 340 & 0.62\cdot 0 & 0.62\cdot 450 \\ 0.62 \cdot 360 & 0.62\cdot 450 & 0.62\cdot 360 \end{bmatrix} = \begin{bmatrix} 0 & 210.8 & 223.2 \\ 210.8 & 0 & 279 \\ 223.2 & 279 & 0 \end{bmatrix} }[/math]
Next, we present two examples that can be used to introduce matrix multiplication.
Cost comparison
Alice and Bob need to buy some apples and pears. Alice needs 2 kg of apples and 5 kg of pears. Bob needs 3 kg of apples and 1 kg of pears. The first store in town offers apples for $1/kg and pears for $4/kg. The second store offers apples for $2/kg and pears for $3/kg. Assuming they will go only to one store each, which stores should Alice and Bob make their purchases at?
We can represent the information given above using two matrices: price matrix P and weight matrix W (see pictures on the right).
[math]\displaystyle{ P =\begin{bmatrix} 1 & 4 \\ 2 & 3 \end{bmatrix}\text{ and } W =\begin{bmatrix} 2 & 3 \\ 5 & 1 \end{bmatrix} }[/math]
System of linear equations


