Matrix Multiplication Properties & Examples
Matrix multiplication, a fundamental operation in linear algebra, is integral to understanding matrix calculus and its applications in data science, machine learning, and computer graphics. This process involves multiplying entries in a manner more complex than simply multiplying corresponding elements, making it a distinct concept from simple matrix addition and scalar multiplication. In this article, we'll unravel the properties of matrix multiplication, augmented with illustrative examples.
Before diving into matrix multiplication, let's establish matrix basics. A matrix is a rectangular grid of numbers, represented as 'M'. The rows and columns are respectively represented by m and n. The entry at the i-th row and j-th column is denoted as 'M[i][j]'. A matrix with m rows and n columns is called an m x n matrix.
Understanding Matrix Multiplication
Matrix multiplication is only defined when the number of columns in the first matrix (denoted as 'n') is equal to the number of rows in the second matrix (denoted as 'p'). The result is an m x p matrix, where m is the number of rows in the first matrix.
To compute the element at the i-th row and k-th column in the product matrix, we multiply each entry in the i-th row of the first matrix by the corresponding entry in the k-th column of the second matrix, then sum these products.
Product of Two Matrices
The product of two matrices 'A' and 'B', denoted as 'A x B', is computed as follows:
| Col 1 | Col 2 | |
|---|---|---|
| Row 1 | a11 | a12 |
| Row 2 | a21 | a22 |
| Col 1 | Col 2 | |
|---|---|---|
| Row 1 | b11 | b12 |
| Row 2 | b21 | b22 |
| Col 1 | Col 2 | |
|---|---|---|
| Row 1 | p11 | p12 |
| Row 2 | p21 | p22 |
The product element pij is computed as: pij = a1j * b1j + a2j * b2j
Examples of Matrix Multiplication
Let's compute the product of two matrices:
| Col 1 | Col 2 | |
|---|---|---|
| Row 1 | 1 | 2 |
| Row 2 | 3 | 4 |
| Col 1 | Col 2 | Col 3 | |
|---|---|---|---|
| Row 1 | 5 | 7 | 9 |
| Row 2 | 10 | 14 | 18 |
| Col 1 | Col 2 | |
|---|---|---|
| Row 1 | 19 | 22 |
| Row 2 | 43 | 50 |
Properties of Matrix Multiplication
Associative Property (A * B) * C = A * (B * C): This property ensures that the order of matrices can be modified without changing the final result, as long as the matrix dimensions support multiplication.
For example, let's consider matrices A, B, and C: \[ A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}, \quad B = \begin{bmatrix} 5 & 6 \\ 7 & 8 \end{bmatrix}, \quad C = \begin{bmatrix} 9 & 0 \\ 0 & 1 \end{bmatrix} \]
(A * B) * C = C * (B * A) = \[ \begin{bmatrix} 19 & 22 \\ 43 & 50 \end{bmatrix} * \begin{bmatrix} 9 & 0 \\ 0 & 1 \end{bmatrix} = \begin{bmatrix} 9 & 0 \\ 0 & 1 \end{bmatrix} * \begin{bmatrix} 19 & 22 \\ 43 & 50 \end{bmatrix} \]
It's crucial to note that matrix multiplication is not commutative, meaning that A * B does not necessarily equal B * A. Additionally, matrix multiplication is distributive over addition. The key takeaway here is to understand that matrix multiplication doesn't follow the same rules we use for scalar multiplication.
| Matrix Multiplication | Scalar Multiplication | |
|---|---|---|
| A | Uses a modified rule | Adds or multiplies by scalar factor |
| Associative property | Holds true | Holds true |
| Commutative property | Does not hold true | Holds true |
| Distributive property | Has a modified rule | Holds true |
Identity Matrices
An identity matrix (I) is a square matrix where all the entries in the main diagonal are 1, and the remaining entries are 0. A property of identity matrices is that multiplication with an identity matrix returns the original matrix: \[ A * I = I * A = A \]
Using our earlier matrix 'A': \[ A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} \]”, multiplying it with an identity matrix I: \[ I = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} \]", returns the original matrix: \[ A * I = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} \]".
This property is particularly useful in computing An as (An-1 * I), as it allows us to calculate the power of a matrix more efficiently.
Inverse Matrices
An inverse matrix A-1 of A exists if and only if |A| ≠ 0, where |A| represents the determinant of A. The product of a matrix and its inverse is an identity matrix: \[ A * A^{-1} = I \]
To illustrate, if we find the inverse of matrix A and multiply it with A: \[ A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} \]" First, we find the determinant: |A| = (1 * 4) - (2 * 3) = -2. Then, we find the adjugate (adjoint) of A, which involves swapping the elements on the diagonal, changing the signs of the off-diagonal elements, and dividing by the determinant: \[ A^{-1} = -\frac{1}{2} * \begin{bmatrix} 4 & -2 \\ -3 & 1 \end{bmatrix} = \begin{bmatrix} -2 & 1 \\ \frac{3}{2} & -\frac{1}{2} \end{bmatrix} \]" Now, A * A-1: \[ \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} * \begin{bmatrix} -2 & 1 \\ \frac{3}{2} & -\frac{1}{2} \end{bmatrix} = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} \]" equals an identity matrix (I).
Inverse matrices are essential for solving systems of equations, as they provide a straightforward method for finding the solution 'x' in the equation 'A * x = b':
This completes our exploration of matrix multiplication, featuring examples and properties. Understanding these concepts is instrumental in leveraging matrices to perform calculations, analyze data, and simulate systems.
Ultimately, matrix manipulation empowers us to draw insights from data and build sophisticated models. Dive into practical applications, like machine learning algorithms, neural networks, and computer vision, to develop a deeper appreciation for the power of matrix operations.