You've asked about multiplying matrices.

I'll use an example to show how it works.

John, Mary and Paul are buying sweets.

John buys 2 choc bars, 1 fruity sweet, no chews and 3 lollipops.

Mary buys 4 choc bars, no fruity sweets, 1 chew and 1 lollipop.

Paul buys no choc bars, 1 fruity sweet, 2 chews and 1 lollipop.

We can summarise that using a 3 by 4 matrix.

Here are the prices:

choc bars 15p; fruity sweets 7p; chews 2p; lollipops 5p.

We can put that in a 4 by 1 matrix.

So now let's find out how much each child has to pay. We can multiply the two matrices. The number of columns in the first must match the number of rows in the second. The answer matrix has the same rows as the first and the same columns as the second. ie 3 by 4 times 4 by 1 gives a 3 by 1 result.

Each row of the first is combined with each column of the second by multiplying the first elements, then adding the second elements multiplied, then adding the third elements multiplied and so on.

So if the Nth row of the first consists of {a b c d e} and the Mth column of the second consists of {p q r s t}, then the Nth row Mth column value of the product is ap + bq + cr + ds + et

Hope that helps,

Bob

]]>