Matrix multiplication is a fundamental operation in linear algebra. Unlike matrix addition or subtraction where elements are operated on directly, matrix multiplication has its own specific rules.
The element cij in matrix C (i.e., the element in the i-th row and j-th column) is calculated by multiplying each element in the i-th row of matrix A by the corresponding element in the j-th column of matrix B, and then summing all these products.
Mathematically, if A=[aik] and B=[bkj], then the element cij of matrix C=AB is:
cij=k=1∑naikbkj=ai1b1j+ai2b2j+⋯+ainbnj
The notation ∑ (sigma) means summation.
In the formula above, we sum the products aikbkj for all values of k from 1 to n.
Let's look at a simple example to understand the process.
Suppose we have matrices P=[p11p21p12p22] and Q=[q11q21q12q22].
Matrix P has an order of 2×2 and matrix Q also has an order of 2×2. The number of columns in P (which is 2) is equal to the number of rows in Q (which is 2), so we can multiply them. The result, R=PQ, will have an order of 2×2.
R=[r11r21r12r22]
The elements of matrix R are calculated as follows:
r11=(row 1 of P)⋅(column 1 of Q)=p11q11+p12q21
r12=(row 1 of P)⋅(column 2 of Q)=p11q12+p12q22
r21=(row 2 of P)⋅(column 1 of Q)=p21q11+p22q21
r22=(row 2 of P)⋅(column 2 of Q)=p21q12+p22q22
Matrix multiplication has several important properties:
Generally Not Commutative:
This means AB=BA. We have already seen an example above where AB is defined but BA is not. Even if both are defined, the results are not necessarily the same.
Associative:
If the matrix multiplications A,B, and C are defined, then (AB)C=A(BC) holds. This means the order of grouping the multiplication does not change the final result.
Distributive:
Matrix multiplication is distributive over matrix addition or subtraction:
A(B+C)=AB+AC
(A+B)C=AC+BC
Multiplication by Identity Matrix (I):
If A is a square matrix of order n×n and I is the identity matrix of order n×n, then:
Matrix multiplication is very useful in various fields, one of which is for managing data and calculating aggregate values.
Imagine a home industry produces three types of food: tempeh chips, banana chips, and potato chips.
These foods are marketed in three places: Place A, Place B, and Place C.
The number of chips (in jars) sold in each place is presented in matrix P. The columns in matrix P respectively represent Place A, Place B, and Place C, while the rows respectively represent tempeh chips, banana chips, and potato chips.
The first row ([151220]) means 15 jars of tempeh chips were sold in Place A, 12 in Place B, and 20 in Place C.
The price for each jar of chips (in rupiah) is stated in the column matrix Q below:
Q=20,00015,00030,000Price of Tempeh ChipsPrice of Banana ChipsPrice of Potato Chips
To determine the total revenue from each type of chip across all places, we can multiply matrix P by matrix Q.
However, pay attention to the order of the matrices. Matrix P has an order of 3×3 and matrix Q has an order of 3×1. The number of columns in P (3) is equal to the number of rows in Q (3), so PQ can be calculated and will result in a matrix R of order 3×1.
Matrix R=PQ will show the total revenue for each type of chip.
R=1,080,0001,100,0001,125,000Total Revenue from Tempeh ChipsTotal Revenue from Banana ChipsTotal Revenue from Potato Chips
From matrix R, we can see that the total revenue from the sale of tempeh chips is Rp1,080,000, banana chips Rp1,100,000, and potato chips Rp1,125,000.
If the question is "determine the revenue matrix for each place", then we need to arrange the price matrix Q differently or perform multiplication with the transpose of P.
Suppose we want to find the total revenue in Place A, Place B, and Place C. We can use the price matrix as a row matrix QT=[20,00015,00030,000] and multiply it by matrix P: S=QTP.
Matrix QT has an order of 1×3 and P has an order of 3×3. The result S will have an order of 1×3.
This means the total revenue from Place A is Rp1,125,000, from Place B is Rp840,000, and from Place C is Rp1,225,000.
The interpretation of the elements of the resulting matrix greatly depends on how the initial matrices are defined and how the multiplication is performed.