Matrix products in context

Matrix products in context

Secondary 4

Products of data matrices

A product of two data matrices gives totals when the columns of the first matrix and the rows of the second matrix stand for the same categories, listed in the same order. Each entry of the answer then belongs to a row of the first matrix and a column of the second.

Method

  1. Write what the rows and the columns of each matrix stand for, with units.
  2. Arrange the matrices so that the columns of the first and the rows of the second are the same categories in the same order.
  3. Check the orders: \((m\times n)(n\times p)\) gives an \(m\times p\) answer.
  4. Multiply row by column.
  5. State the meaning of each entry: its row comes from the first matrix, its column from the second, and the unit is the product of the units.

Example: one price column for each shop

Two families buy rice (kg) and eggs (trays). Shop X and Shop Y charge different prices.

QuantityRice (kg)Eggs (trays)
Family A43
Family B25
Price (dollars)Shop XShop Y
Rice, per kg2.502.80
Eggs, per tray4.003.50

\(Q=\begin{pmatrix}4&3\\ 2&5\end{pmatrix}\) (rows: Family A, Family B; columns: rice, eggs) \(P=\begin{pmatrix}2.50&2.80\\ 4.00&3.50\end{pmatrix}\) (rows: rice, eggs; columns: Shop X, Shop Y)

The columns of \(Q\) and the rows of \(P\) are both rice, eggs, so \(QP\) has order \((2\times2)(2\times2)\to2\times2\).

\(QP=\begin{pmatrix}4(2.50)+3(4.00)&4(2.80)+3(3.50)\\ 2(2.50)+5(4.00)&2(2.80)+5(3.50)\end{pmatrix}=\begin{pmatrix}22.00&21.70\\ 25.00&23.10\end{pmatrix}\)

  • Row 1, column 1, \(22.00\): Family A's order costs 22.00 dollars at Shop X.
  • Row 1, column 2, \(21.70\): Family A's order costs 21.70 dollars at Shop Y.
  • Row 2, column 1, \(25.00\): Family B's order costs 25.00 dollars at Shop X.
  • Row 2, column 2, \(23.10\): Family B's order costs 23.10 dollars at Shop Y.

The unit is kilograms (or trays) times dollars per kilogram (or per tray), which gives dollars. Comparing along each row, both families pay less at Shop Y.

Totals with a row of ones

A row of ones on the left adds the entries in each column: \(\begin{pmatrix}1&1\end{pmatrix}Q=\begin{pmatrix}1&1\end{pmatrix}\begin{pmatrix}4&3\\ 2&5\end{pmatrix}=\begin{pmatrix}6&8\end{pmatrix}\), so the two families buy 6 kg of rice and 8 trays of eggs altogether. In the same way, \(\begin{pmatrix}1&1\end{pmatrix}(QP)=\begin{pmatrix}47.00&44.80\end{pmatrix}\): the two orders together cost 47.00 dollars at Shop X and 44.80 dollars at Shop Y. A column of ones on the right adds the entries in each row instead.

Check

List the prices in the same order as the categories. If the rows of \(P\) were eggs then rice, \(QP\) would multiply kilograms of rice by the price of a tray of eggs, and every entry would be wrong even though the product still exists.

\(PQ\) also exists here, because both matrices are \(2\times2\), but it would pair the shops (columns of \(P\)) with the families (rows of \(Q\)), so it has no meaning. Choose the order of multiplication from the categories, not only from the orders.

Need help? Join our E-Maths tuition for O-Level success.

Learn more