Part 2 : Operations on Matrices
A matrix A of order 3×3 can be represented as
Here, element in row 1 and column 1 is denoted as a11, element in row 2 and column 1 as a21 and so on.
Equality of Matrices
For matrices to be equal
- Order of matrices should be same
- All the elements should be same
Addition of Matrices
For adding two matrices the element corresponding to same row and column are added together, like in example below matrix A of order 3×2 and matrix B of same order are added.
Element at a11 from matrix A and Element at b11 from matrix B will be added such that c11 of matrix C is produced.
Notice, that A and B are of same order. So, for matrices to be added the order of all the matrices (to be added) should be same. Also, the resulting matrix will be of same order as its constituents.
Subtraction of Matrices
Subtraction of matrix is similar to addition of matrix. In the example below,
matrix D - matrix E = matrix F
Multiplication of Matrix with Scalar
Here, scalar is a quantity that’s not a matrix or just a constant (scalars will be given a better definition in a future article about Vectors).
When we multiply 2 (Scalar) with matrix G, the resulting matrix H is just 2 multiplied with each element of matrix G.
Division of Matrix with Scalar
Division with scalar is quite similar to multiplication with scalar as dividing a matrix J with 3 (scalar) is same as multiplying matrix J with 1/3.
As, J/3 = (1/3) × J = K
Multiplication of Matrices
Matrix multiplication is quite difficult to grasp at first because unlike addition and subtraction, multiplication is not done multiplying corresponding elements of same row and column.
One way of multiplying matrix is described through an example below (and two more ways will be described in future articles namely).
For finding elements of matrix N
- Element in row 1 and column 1 of matrix U will be multiplied with element in row 1 and column 1 of matrix M (u11 × m11).
- Element at row 1 and column 2 of matrix U will be multiplied with element at row 2 and column 1 of matrix M (u12 × m21).
- Addition of both products calculated above will give the element at row 1 and column 1 of matrix N (n11 = u11 × m11 + u12 × m21).
Substituting with values from matrix U and matrix M.
n11 = 1 × 3 + 6 × 1 = 9
So, row 1 of matrix U and column 1 of matrix M gave element at first row and first column of matrix N (n11).
Applying similar operations on row 1 of matrix U and column 2 of matrix M will give the element in first row and second column of matrix N (n12). Further calculations for elements of matrix N are done below.
Similar operations can be applied by selecting column 1 from matrix U and row 1 from matrix M, such that
n11 = u11 × m11 + u21 × m12 + u31 × m13
and the resulting matrix will be same as matrix N.
So, the matrix multiplication can be done either by multiplying and adding elements of rows of first matrix(U) and columns of second matrix(M) or columns of first matrix(U) and rows of second matrix(M), and the result will be same.
Notice that matrix N has order of 3 × 3, matrix U has order of 3 × 2 and matrix M has order 2 × 3. Hence, the order of resulting matrix from multiplication is (number of rows of first matrix) × (number of columns of second matrix).
Also, if the number of columns of first matrix is not equal to number of rows of second matrix the multiplication is not possible (because there won’t be adequate number elements to apply operations on).
Matrix multiplication is not commutative
The product of matrix U and matrix M won’t be equal to product of matrix M and matrix U.
matrix U × matrix M ≠ matrix M × matrix U
Hence, matrix multiplication is not commutative.
Division of Matrices
Matrix division is possible, but it is not like scalar division discussed above.
Dividing matrix B by matrix A (B/A), could also be written as B × A⁻¹.
Here, A⁻¹ is an inverse matrix of A (inverses will be discussed later).
A⁻¹ is simply a matrix that on multiplication with matrix A gives I(Identity Matrix, will also be discussed in future articles). Just as 2 × 2⁻¹ = 1.
Read Part 3 : Types of Matrices, Diagonal, and Transpose
You can view the complete series here
I’m now publishing at avni.sh
Connect with me on LinkedIn.