In linear algebra, matrices play an important role in dealing with different concepts. A matrix is a rectangular array or table of numbers, symbols, or expressions, arranged in rows and columns in mathematics. We can perform various operations on matrices such as addition, subtraction, multiplication and so on. In this article, you will learn how to multiply a matrix by another matrix, its algorithm, formula, 2×2 and 3×3 matrix multiplication with examples in detail.
Table of Contents: |
Matrix Multiplication Definition
Matrix multiplication, also known as matrix product and the multiplication of two matrices, produces a single matrix. It is a type of binary operation.
If A and B are the two matrices, then the product of the two matrices A and B are denoted by:
X = AB
Hence, the product of two matrices is the dot product of the two matrices.
Matrix multiplication by Scalar
Multiplication of an integer with a matrix is simply a scalar multiplication.
We know that a matrix is an array of numbers. It consists of rows and columns. If you multiply a matrix by a scalar value, then it is known as scalar multiplication. Another case is that it is possible to multiply a matrix by another matrix. Let’s have a look at the example given below for the same.
We may define multiplication of a matrix by a scalar mathematically as:
If A = [aij]m × n is a matrix and k is a scalar, then kA is another matrix obtained by multiplying each element of A by the scalar k.
In other words, kA = k [aij]m × n = [k (aij)]m × n, that is, (i, j)th element of kA is kaij for all possible values of i and j.
Example: Multiply the matrix
Solution:
Given,
4 × A =
Now, we have to multiply each element of the matrix A by 4.
This is the required matrix after multiplying the given matrix by the constant or scalar value, i.e. 4.
Matrix multiplication Condition
To perform multiplication of two matrices, we should make sure that the number of columns in the 1st matrix is equal to the rows in the 2nd matrix. Therefore, the resulting matrix product will have a number of rows of the 1st matrix and a number of columns of the 2nd matrix. The order of the resulting matrix is the matrix multiplication order.
Also, read:
Now, let’s understand how to do matrix multiplication with different orders or different types of matrices.
How to Multiply Matrices?
Let’s learn how to multiply matrices.
Consider matrix A which is a × b matrix and matrix B, which is a b ×c matrix.
Then, matrix C = AB is defined as the A × B matrix.
An element in matrix C, Cxy is defined as Cxy = Ax1By1 +….. + AxbBby =
This is one of the most important topics in class 12. Matrices for class 12 explains the types of matrices in detail.
Notation
If A is a m×n matrix and B is a p×q matrix, then the matrix product of A and B is represented by:
X = AB
Where X is the resulting matrix of m×q dimension.
Matrix Multiplication Formula
Let’s take an example to understand this formula.
Let’s say A and B are two matrices, such that,
Then Matrix C = AB is denoted by
C =
An element in matrix C where C is the multiplication of Matrix A X B.
C = Cxy = Ax1By1 +….. + AxbBby =
Algorithm for Matrix Multiplication
There has been a significant amount of work in recent years in the field of matrix multiplication algorithms as it has found its application in many areas. There are four types of algorithms:
- Iterative Algorithm
- Divide and conquer algorithm
- Sub-cubic algorithms
- Parallel and distributed algorithms
This is majorly used in various programming languages such as C, Java, etc., for online multiplication. The most common are 2×2, 3×3 and 4×4, multiplication of matrices.
The operation is binary with entries in a set on which the operations of addition, subtraction, multiplication, and division are defined. These operations are the same as the corresponding operations on real and rational numbers.
Although there are many applications of matrices, essentially, multiplication of matrices is an operation in linear algebra. The linear mapping, which includes scalar addition and multiplication, is represented by matrix multiplication.
One can also find a wide range of algorithms on meshes. This type of algorithm is designed to minimize the inherent inefficiency of standard array algorithms where there can be a delay in the arrival of data from 2 different matrices.
Matrix multiplication Rules
From the above defined formula and procedure, we can write the following rules and properties for matrix multiplication.
- The product of two matrices A and B is defined if the number of columns of A is equal to the number of rows of B.
- If AB is defined, then BA need not be defined
- If both A and B are square matrices of the same order, then both AB and BA are defined.
- If AB and BA are both defined, it is not necessary that AB = BA.
- If the product of two matrices is a zero matrix, it is not necessary that one of the matrices is a zero matrix.
2×2 Matrix Multiplication
Let’s consider a simple 2 × 2 matrix multiplication A =
Now each of the elements of product matrix AB can be calculated as follows:
- AB11 = 3 × 6 + 7 ×5 = 53
- AB12 = 3 × 2 + 7 × 8 = 62
- AB21 = 4 × 6 + 9 × 5 = 69
- AB22 = 4 × 2 + 9 × 8 = 80
Therefore matrix AB =
3×3 Matrix Multiplication
To understand the multiplication of two 3 × 3 matrices, let us consider two 3 × 3 matrices A and B.
Matrix A =
Each element of the Product matrix AB can be calculated as follows:
- AB11 = 12×5 + 8×6 + 4×7 = 136
- AB12 = 12×19 + 8×15 + 4×8 = 380
- AB13 = 12×3 + 8×9+4×16 = 172
- AB21 = 3×5 + 17×6 + 14×7 = 215
- AB22 = 3×19 + 17×15 + 14×8 = 424
- AB23 = 3×3 + 17×9 + 14×16 = 386
- AB31 = 9×5 + 8×6 + 10×7 = 163
- AB32 = 9×19 + 8×15 + 10×8 = 371
- AB33 = 9×3 + 8×9 + 10×16 = 259
Therefore, Matrix AB =
Try out: Matrix Multiplication Calculator
Properties of Matrix Multiplication
The following are the properties of the matrix multiplication:
Commutative Property
The matrix multiplication is not commutative.
Assume that, if A and B are the two 2×2 matrices,
AB ≠ BA
In matrix multiplication, the order matters a lot.
For example,
If
But,
This shows that the matrix AB ≠BA.
Hence, the multiplication of two matrices is not commutative.
Associative Property
If A, B and C are the three matrices, the associative property of matrix multiplication states that,
(AB) C = A(BC)
Let
LHS = (AB) C
RHS = A(BC)
Hence, the associative property of matrix multiplication is proved.
Distributive Property
If A, B and C are the three matrices, the distributive property of matrix multiplication states that,
- (B+C)A = BA +CA
- A(B+C) = AB + AC
Multiplicative Identity Property
The identity property of matrix multiplication states that,
- I = I. A = A
Where A is an n× n matrix and “I” is an identity matrix of order n.
Let
Dimension Property
In matrix multiplication, the product of m × n matrix and n×a matrix is the m× a matrix.
For example, matrix A is a 2 × 3 matrix and matrix B is a 3 × 4 matrix, then AB is a 2 × 4 matrices.
Multiplicative property of Zero
If a matrix is multiplied by a zero matrix, the result matrix is a zero matrix.
If
Solved Example
Multiplication of 4×4 matrices is explained below with two 4×4 matrices A and B.
A =
Following the same steps as in the previous 2 examples, we can construct an AB matrix.
AB =
Practice Problems on Matrix Multiplication
Solve the following problems:
- Find the product: \(\begin{array}{l}3\begin{bmatrix} 7 & 5\\ 2 & 1 \end{bmatrix}\end{array} \)
- Simplify the following 3×3 matrix: \(\begin{array}{l}\begin{bmatrix} 1 & 6 & 2 \\ 2 & 3 & 1\\ 1 & 1 & 5 \end{bmatrix}\times \begin{bmatrix} 1 & 8 & 7 \\ 4 & 2 & 3 \\ 2 & 6 & 1 \end{bmatrix}\end{array} \)
- Find the product of AB, if \(\begin{array}{l}A =\begin{bmatrix} 5 & 3\\ 9 & 1 \end{bmatrix}\end{array} \)and\(\begin{array}{l}B =\begin{bmatrix} 1 & 0\\ 6 & 12 \end{bmatrix}\end{array} \)
- Find the product of the matrix, if \(\begin{array}{l}A = \begin{bmatrix} 4\\ 2\\ 1 \end{bmatrix}\end{array} \)and\(\begin{array}{l}\begin{bmatrix} 2 & 4 & 6 \end{bmatrix}\end{array} \)
- Calculate: \(\begin{array}{l}\frac{-4}{7}\begin{bmatrix} -22\\ 49\\ 35 \end{bmatrix}\end{array} \)
Learn more about Matrices and other related topics in a fun and enjoyable way. Download BYJU’S – The Learning App today.
Frequently Asked Questions – FAQs
What is matrix multiplication?
How to multiply two given matrices?
What is the result of multiplication of (2×3) matrix and (3×3) matrix?
How to multiply 3×3 matrix?
How do we find the multiplication of two matrices?
C = AB
Thus, C will be an m×q matrix.
Comments