Complete Examples of Matrix
Operations
1. Matrix Addition
To add two matrices, add their corresponding elements.
A = [[2, 3], [4, 1]]
B = [[1, 5], [2, 0]]
Step-by-step:
(2 + 1) = 3, (3 + 5) = 8, (4 + 2) = 6, (1 + 0) = 1
Result:
A + B = [[3, 8], [6, 1]]
2. Matrix Subtraction
To subtract matrices, subtract their corresponding elements.
A = [[2, 3], [4, 1]]
B = [[1, 5], [2, 0]]
Step-by-step:
(2 - 1) = 1, (3 - 5) = -2, (4 - 2) = 2, (1 - 0) = 1
Result:
A - B = [[1, -2], [2, 1]]
3. Matrix Multiplication
Multiply rows of the first matrix by columns of the second matrix.
A = [[2, 3], [4, 1]]
B = [[1, 5], [2, 0]]
Step-by-step:
(2×1 + 3×2) = 8, (2×5 + 3×0) = 10
(4×1 + 1×2) = 6, (4×5 + 1×0) = 20
Result:
A × B = [[8, 10], [6, 20]]
4. Matrix Transpose
The transpose of a matrix is obtained by interchanging its rows and columns.
A = [[2, 3], [4, 1]]
Step-by-step:
Row 1 becomes Column 1 → [2, 4]
Row 2 becomes Column 2 → [3, 1]
Result:
Aᵀ = [[2, 4], [3, 1]]
5. Determinant of a 2×2 Matrix
For a 2×2 matrix:
A = [[a, b], [c, d]]
Det(A) = (a×d) - (b×c)
Example:
A = [[2, 3], [4, 1]]
Det(A) = (2×1) - (3×4) = 2 - 12 = -10
6. Adjoint of a 2×2 Matrix
The adjoint of a matrix is the transpose of its cofactor matrix.
For A = [[a, b], [c, d]]
Adj(A) = [[d, -b], [-c, a]]
Example:
A = [[2, 3], [4, 1]]
Adj(A) = [[1, -3], [-4, 2]]
7. Inverse of a 2×2 Matrix
Formula: A⁻¹ = (1 / det(A)) × Adj(A)
For A = [[2, 3], [4, 1]]
Det(A) = -10
Adj(A) = [[1, -3], [-4, 2]]
Step-by-step:
A⁻¹ = (1 / -10) × [[1, -3], [-4, 2]]
Result:
A⁻¹ = [[-0.1, 0.3], [0.4, -0.2]]
8. Rank of a Matrix
The rank of a matrix is the number of linearly independent rows or columns.
Example:
A = [[2, 4], [1, 2]]
Here, the second row is a multiple of the first row (Row 2 = 0.5 × Row 1).
So, only one row is linearly independent.
Result:
Rank(A) = 1