Maths Formulae Matrices Multiplication Of Matrices

Multiplication of Matrices – Rules and Conditions

Explore matrix multiplication rules, conditions for compatibility, and techniques for 2x2, 3x3, and general matrices.
🔑

Definition of Matrix Multiplication

Matrix multiplication is a binary operation that produces a single matrix from two matrices. For the operation to be defined, the number of columns in the first matrix must be equal to the number of rows in the second matrix. The resulting matrix, known as the matrix product, will have the number of rows of the first matrix and the number of columns of the second matrix. The entry in row i and column j of the product matrix is calculated by taking the dot product of the i-th row of the first matrix with the j-th column of the second matrix.

\[ C_{ij} = \sum_{k=1}^{n} A_{ik} \cdot B_{kj} \]
General Formula for an Element
\[ A_{m \times n} \times B_{n \times p} = C_{m \times p} \]
Dimension Compatibility Rule
SymbolDescription
\[A\]First matrix in the multiplication, with dimensions m×n.
\[B\]Second matrix in the multiplication, with dimensions n×p.
\[C\]Product matrix resulting from AB, with dimensions m×p.
\[C_{ij}\]The element in the i-th row and j-th column of the product matrix C.
\[m\]Number of rows in the first matrix A and the product matrix C.
\[n\]Number of columns in the first matrix A and rows in the second matrix B. This is the inner dimension that must match.
\[p\]Number of columns in the second matrix B and the product matrix C.
✖️

Key Formulas for Matrix Multiplication

\[ xA = x \cdot \begin{bmatrix} a & b \\ c & d \end{bmatrix} = \begin{bmatrix} xa & xb \\ xc & xd \end{bmatrix} \]
Scalar Multiplication
\[ \begin{bmatrix} a & b \end{bmatrix}_{1 \times 2} \cdot \begin{bmatrix} x & y \\ z & u \end{bmatrix}_{2 \times 2} = \begin{bmatrix} ax + bz & ay + bu \end{bmatrix}_{1 \times 2} \]
Row Vector by Matrix
\[ \begin{bmatrix} a & b \\ c & d \end{bmatrix} \cdot \begin{bmatrix} x & y \\ z & u \end{bmatrix} = \begin{bmatrix} ax + bz & ay + bu \\ cx + dz & cy + du \end{bmatrix} \]
2x2 Matrix Multiplication
\[ \begin{bmatrix} a & b & c \end{bmatrix}_{1 \times 3} \cdot \begin{bmatrix} x \\ y \\ z \end{bmatrix}_{3 \times 1} = \begin{bmatrix} ax + by + cz \end{bmatrix}_{1 \times 1} \]
Row Vector by Column Vector (Dot Product)
\[ \begin{bmatrix} x \\ y \\ z \end{bmatrix}_{3 \times 1} \cdot \begin{bmatrix} a & b & c \end{bmatrix}_{1 \times 3} = \begin{bmatrix} xa & xb & xc \\ ya & yb & yc \\ za & zb & zc \end{bmatrix}_{3 \times 3} \]
Column Vector by Row Vector (Outer Product)
\[ \begin{bmatrix} a & b & c \\ p & q & r \\ u & v & w \end{bmatrix}_{3 \times 3} \cdot \begin{bmatrix} x \\ y \\ z \end{bmatrix}_{3 \times 1} = \begin{bmatrix} ax + by + cz \\ px + qy + rz \\ ux + vy + wz \end{bmatrix}_{3 \times 1} \]
3x3 Matrix by Column Vector
\[ \begin{bmatrix} a & b & c \\ p & q & r \\ u & v & w \end{bmatrix} \cdot \begin{bmatrix} \alpha & \beta & \gamma \\ \lambda & \mu & \xi \\ \rho & \sigma & \tau \end{bmatrix} = \begin{bmatrix} a\alpha + b\lambda + c\rho & a\beta + b\mu + c\sigma & a\gamma + b\xi + c\tau \\ p\alpha + q\lambda + r\rho & p\beta + q\mu + r\sigma & p\gamma + q\xi + r\tau \\ u\alpha + v\lambda + w\rho & u\beta + v\mu + w\sigma & u\gamma + v\xi + w\tau \end{bmatrix} \]
3x3 Matrix Multiplication
🖼️

Visualizing Matrix Multiplication

A (2×3) 1 2 3 4 5 6 × B (3×2) 7 8 9 10 11 12 = C (2×2) 58 64 139 154 C[i][j] = row i of A · col j of B (dot product)
Matrix Multiplication: each entry C[i][j] = dot product of row i from A with column j of B. Dimensions: (m×k)(k×n) → (m×n).

A diagram illustrating matrix multiplication would show an m×n matrix A on the left and an n×p matrix B on the right. To find the element C_ij in the resulting m×p matrix C, the diagram would highlight row 'i' of matrix A and column 'j' of matrix B. Arrows would connect corresponding elements (the first element of the row to the first element of the column, the second to the second, and so on), indicating they are multiplied together. These products are then shown being summed to produce the single resulting element C_ij, which is placed in its corresponding position in the product matrix C.

⚖️

Properties of Matrix Multiplication

\[ (AB)C = A(BC) \]
Associative Property
\[ A(B + C) = AB + AC \]
Left Distributive Property
\[ (A + B)C = AC + BC \]
Right Distributive Property
\[ AB \neq BA \text{ (in general)} \]
Non-Commutative Property

The order of multiplication is crucial. Unlike with scalar numbers, reversing the order of matrices in multiplication (A×B vs B×A) will generally produce a different result, or may not be possible at all if the dimensions become incompatible.

🔬

Derivation of a 2x2 Matrix Product

To derive the product of two 2x2 matrices, we apply the general definition of matrix multiplication to each element of the resulting matrix. Each element is the dot product of a row from the first matrix and a column from the second.

\[ \text{Let } A = \begin{bmatrix} a & b \\ c & d \end{bmatrix} \text{ and } B = \begin{bmatrix} e & f \\ g & h \end{bmatrix} \]
Given Matrices

The product C = AB will be a 2x2 matrix. Let's find each element C_ij.

\[ C_{11} = (\text{Row 1 of A}) \cdot (\text{Column 1 of B}) = a \cdot e + b \cdot g \]
Step 1: Calculate element C₁₁
\[ C_{12} = (\text{Row 1 of A}) \cdot (\text{Column 2 of B}) = a \cdot f + b \cdot h \]
Step 2: Calculate element C₁₂
\[ C_{21} = (\text{Row 2 of A}) \cdot (\text{Column 1 of B}) = c \cdot e + d \cdot g \]
Step 3: Calculate element C₂₁
\[ C_{22} = (\text{Row 2 of A}) \cdot (\text{Column 2 of B}) = c \cdot f + d \cdot h \]
Step 4: Calculate element C₂₂

Combining these elements gives the final product matrix:

\[ C = AB = \begin{bmatrix} ae+bg & af+bh \\ ce+dg & cf+dh \end{bmatrix} \]
Final Result
🧠

Worked Example: Numerical Multiplication

Given matrix \( A = \begin{bmatrix} 2 & 1 \\ 4 & 3 \end{bmatrix} \) and matrix \( B = \begin{bmatrix} 5 & 6 \\ 7 & 8 \end{bmatrix} \), find the product AB.
  1. Identify the dimensions. A is 2x2 and B is 2x2. The inner dimensions match (2=2), so multiplication is possible. The result will be a 2x2 matrix.
  2. Calculate the element C₁₁ (row 1 of A × column 1 of B): (2 * 5) + (1 * 7) = 10 + 7 = 17.
  3. Calculate the element C₁₂ (row 1 of A × column 2 of B): (2 * 6) + (1 * 8) = 12 + 8 = 20.
  4. Calculate the element C₂₁ (row 2 of A × column 1 of B): (4 * 5) + (3 * 7) = 20 + 21 = 41.
  5. Calculate the element C₂₂ (row 2 of A × column 2 of B): (4 * 6) + (3 * 8) = 24 + 24 = 48.
  6. Assemble the elements into the final matrix C.
The resulting matrix is \( C = AB = \begin{bmatrix} 17 & 20 \\ 41 & 48 \end{bmatrix} \).
🚀

Applications of Matrix Multiplication

🎮 Computer Graphics & Gaming

Matrix multiplication is fundamental for rendering 3D graphics. It is used to perform transformations like rotation, scaling, and translation on objects and camera views. Combining these transformation matrices through multiplication allows for complex animations and realistic movements in a virtual space.

🤖 Machine Learning & AI

In neural networks, data is represented as matrices. The process of a signal passing through layers of neurons is modeled by multiplying the input matrix by a weight matrix. This operation is at the core of how deep learning models are trained and make predictions.

📊 Economics & Business Analytics

Economists use matrices to model systems of linear equations representing economic relationships, such as input-output models. In business, matrix multiplication can be used for supply chain optimization, resource allocation, and analyzing market survey data.

🔬 Scientific Computing & Engineering

Matrix multiplication is essential for solving large systems of linear equations that arise in fields like structural analysis, fluid dynamics, and quantum mechanics. It is used in simulations and modeling to predict the behavior of complex physical systems.

🌍

Real-World Numerical Examples

A bakery sells three types of cakes: chocolate, vanilla, and red velvet. The number of cakes sold at two different branches on a Saturday is given by matrix S. Branch 1 sold 20 chocolate, 15 vanilla, and 10 red velvet. Branch 2 sold 25 chocolate, 30 vanilla, and 12 red velvet. The price of each cake is $15 for chocolate, $12 for vanilla, and $18 for red velvet. Use matrix multiplication to find the total revenue for each branch.
  1. Set up the sales matrix S (2x3) and the price matrix P (3x1).
  2. \( S = \begin{bmatrix} 20 & 15 & 10 \\ 25 & 30 & 12 \end{bmatrix} \) and \( P = \begin{bmatrix} 15 \\ 12 \\ 18 \end{bmatrix} \)
  3. Multiply S by P to get the Revenue matrix R (2x1). R = S × P.
  4. Calculate revenue for Branch 1 (Row 1 of S × P): (20 * 15) + (15 * 12) + (10 * 18) = 300 + 180 + 180 = $660.
  5. Calculate revenue for Branch 2 (Row 2 of S × P): (25 * 15) + (30 * 12) + (12 * 18) = 375 + 360 + 216 = $951.
The total revenue for Branch 1 is $660 and for Branch 2 is $951. The revenue matrix is \( R = \begin{bmatrix} 660 \\ 951 \end{bmatrix} \).
In a simple population model, the number of young and adult birds changes each year. Let the vector \( P_0 = \begin{bmatrix} 100 \\ 80 \end{bmatrix} \) represent the initial population of 100 young and 80 adult birds. Each year, 80% of adults survive and 50% of young birds survive to become adults. Each adult produces 1.2 young birds. Find the population after one year using the transition matrix L.
  1. Set up the transition matrix L. Row 1 represents the new young, Row 2 the new adults. Column 1 is based on the old young, Column 2 on the old adults.
  2. \( L = \begin{bmatrix} 0 & 1.2 \\ 0.5 & 0.8 \end{bmatrix} \). (0 young from young, 1.2 young from adults; 0.5 adults from young, 0.8 adults from adults).
  3. Calculate the population after one year, \( P_1 \), by multiplying the transition matrix L by the initial population vector \( P_0 \). \( P_1 = L \cdot P_0 \).
  4. \( P_1 = \begin{bmatrix} 0 & 1.2 \\ 0.5 & 0.8 \end{bmatrix} \begin{bmatrix} 100 \\ 80 \end{bmatrix} = \begin{bmatrix} (0 \cdot 100 + 1.2 \cdot 80) \\ (0.5 \cdot 100 + 0.8 \cdot 80) \end{bmatrix} \)
  5. Calculate the values: New young = 0 + 96 = 96. New adults = 50 + 64 = 114.
After one year, the population will consist of 96 young birds and 114 adult birds. The new population vector is \( P_1 = \begin{bmatrix} 96 \\ 114 \end{bmatrix} \).
🌐

Matrix Multiplication in the Real World

3D Transform x y z v Rv R×v = rotated vertex 4×4 matrix per object
3D Computer Graphics
Every 3D rotation, scaling, and translation in games and CAD is a matrix multiplication — a 4×4 transform matrix applied to each vertex position vector millions of times per frame.
Neural Network Layer y = Wx + b
Neural Networks
Each neural network layer computes y = Wx + b — a matrix multiplication of weight matrix W by input x. GPUs achieve trillions of such multiplications per second for deep learning.
Leontief Model (I − A)x = d a11 a12 a13 Agr a21 a22 a23 Mfg a31 a32 a33 Svc x = (I−A)⁻¹d — output needed
Economics Modelling
The Leontief input-output model uses matrix multiplication to show how much each industry sector must produce to meet final demand — central to national economic planning and supply chain analysis.

Flight Route Networks Airlines can represent flight routes between cities as a matrix. Multiplying this matrix by itself can reveal the number of ways to travel between two cities with exactly one layover. Further multiplications can find paths with two, three, or more layovers, helping in network analysis and optimization.

Cryptography In secure communication, a message can be converted into a numerical matrix. This message matrix is then multiplied by a secret 'encryption key' matrix to produce an encoded message. The recipient, who has the inverse of the key matrix, can multiply the encoded message by this inverse to decrypt it and reveal the original text.

Medical Imaging Techniques like CT scans and MRI collect data from multiple angles around a body. Complex algorithms use matrix multiplication to process this raw data and reconstruct it into a detailed 2D or 3D cross-sectional image, allowing doctors to see inside the body without surgery.

📚

Types and Special Cases

Certain types of matrix multiplication have special properties that are fundamental in linear algebra.

\[ AI = IA = A \]
Identity Matrix Property
\[ A \cdot 0 = 0 \cdot A = 0 \]
Zero Matrix Property
\[ AA^{-1} = A^{-1}A = I \]
Inverse Multiplication
\[ (kA)B = k(AB) = A(kB) \]
Scalar Factor Property
⚠️

Common Mistakes to Avoid

⚠️ Assuming Commutativity: The most common error is assuming that AB is the same as BA. The order of multiplication is critical and usually changes the result. Always perform the multiplication in the specified order.
⚠️ Dimension Mismatch: Attempting to multiply matrices where the number of columns in the first matrix does not equal the number of rows in the second. Before starting any calculation, write down the dimensions (m×n) and (n×p) and confirm the inner 'n' values match.
💡 Element-wise Multiplication: Students sometimes multiply corresponding elements (A₁₁ × B₁₁, etc.) as is done in matrix addition. This is incorrect. Remember that matrix multiplication is a 'row-by-column' dot product operation.
🚀

Study Strategy

1 📖 Build Your Foundation
  • Confirm you can identify the dimensions (rows x columns) of any given matrix.
  • Master the compatibility rule: for product AB, the number of columns in A must equal the number of rows in B.
  • Learn to predict the dimensions of the product matrix (rows of A x columns of B) before you start calculating.
  • Review the 'Properties of Matrix Multiplication' to understand why order matters (i.e., AB is not always equal to BA).
2 🧠 Commit the Process to Memory
  • Focus on the formula for a single element: the entry in row 'i' and column 'j' is the dot product of row 'i' from the first matrix and column 'j' from the second.
  • Use the 'Derivation of a 2x2 Matrix Product' as a mental model, visualizing the 'row-by-column' movement.
  • Create flashcards for special cases, such as multiplying by the identity matrix or a zero matrix.
  • Verbally explain the step-by-step process of multiplying two 2x2 matrices to solidify your understanding.
3 ✏️ Solidify Through Practice
  • Redo the 'Worked Example: Numerical Multiplication' without looking at the solution, then verify your result.
  • Attempt to multiply matrices with incompatible dimensions to see the rule in action.
  • Practice calculating specific elements of a larger product matrix (e.g., find only the element in row 2, column 3).
  • After each problem, cross-reference your work with the 'Common Mistakes to Avoid' section to self-correct.
4 🌍 Connect to Real-World Applications
  • Analyze the 'Real-World Numerical Examples' and label the rows and columns with their real-world meanings (e.g., 'products', 'stores', 'cost').
  • Formulate your own simple problem based on the 'Applications' section, like calculating the final coordinates of a rotated point.
  • Translate a simple word problem (e.g., calculating total revenue from different products sold in different locations) into a matrix multiplication setup.
  • Explain how the structure of matrix multiplication helps organize and solve a problem from the 'Matrix Multiplication in the Real World' section.
By systematically understanding, memorizing, practicing, and applying, you will master matrix multiplication and unlock its power to solve complex problems.

Frequently Asked Questions

×

×