![]()
Matrices and Matrix Operations – A Detailed Explanation
1. Introduction to Matrices
A matrix is a rectangular array of numbers arranged in rows and columns. Matrices are widely used in various fields, including engineering, computer science, physics, and economics.
For example, a 2 × 3 matrix (2 rows and 3 columns) looks like this: A=[123456]A = \begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{bmatrix}
Each number in the matrix is called an element or entry, and it is usually represented as aija_{ij}, where:
- ii represents the row number.
- jj represents the column number.
For example, in matrix AA, the element in the first row and second column is a12=2a_{12} = 2.
2. Types of Matrices
Matrices come in various types based on their structure and properties:
- Row Matrix: A matrix with only one row. A=[123]A = \begin{bmatrix} 1 & 2 & 3 \end{bmatrix}
- Column Matrix: A matrix with only one column. B=[456]B = \begin{bmatrix} 4 \\ 5 \\ 6 \end{bmatrix}
- Square Matrix: A matrix with the same number of rows and columns. C=[2−153]C = \begin{bmatrix} 2 & -1 \\ 5 & 3 \end{bmatrix}
- Diagonal Matrix: A square matrix where all non-diagonal elements are zero. D=[30007000−2]D = \begin{bmatrix} 3 & 0 & 0 \\ 0 & 7 & 0 \\ 0 & 0 & -2 \end{bmatrix}
- Identity Matrix (II): A square matrix with 1s on the diagonal and 0s elsewhere. I=[100010001]I = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}
- Zero Matrix: A matrix where all elements are zero. O=[0000]O = \begin{bmatrix} 0 & 0 \\ 0 & 0 \end{bmatrix}
- Symmetric Matrix: A square matrix where A=ATA = A^T (transpose). S=[4223]S = \begin{bmatrix} 4 & 2 \\ 2 & 3 \end{bmatrix}
- Triangular Matrix: A matrix that is either upper triangular (all elements below the main diagonal are zero) or lower triangular (all elements above the main diagonal are zero).
3. Matrix Operations
Matrix operations include addition, subtraction, multiplication, determinant calculation, and finding the inverse.
3.1 Matrix Addition
Matrices can be added only if they have the same dimensions.
Example:
A=[1234],B=[5678]A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}, \quad B = \begin{bmatrix} 5 & 6 \\ 7 & 8 \end{bmatrix} A+B=[1+52+63+74+8]=[681012]A + B = \begin{bmatrix} 1+5 & 2+6 \\ 3+7 & 4+8 \end{bmatrix} = \begin{bmatrix} 6 & 8 \\ 10 & 12 \end{bmatrix}
3.2 Matrix Subtraction
Subtracting matrices follows the same rule as addition. A−B=[1−52−63−74−8]=[−4−4−4−4]A – B = \begin{bmatrix} 1-5 & 2-6 \\ 3-7 & 4-8 \end{bmatrix} = \begin{bmatrix} -4 & -4 \\ -4 & -4 \end{bmatrix}
3.3 Scalar Multiplication
A matrix can be multiplied by a scalar (constant), multiplying each element by that scalar.
Example:
c=2,A=[1234]c = 2, \quad A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} 2A=[2×12×22×32×4]=[2468]2A = \begin{bmatrix} 2 \times 1 & 2 \times 2 \\ 2 \times 3 & 2 \times 4 \end{bmatrix} = \begin{bmatrix} 2 & 4 \\ 6 & 8 \end{bmatrix}
4. Matrix Multiplication
4.1 Multiplication of Two Matrices
Matrix multiplication is only possible if the number of columns of the first matrix equals the number of rows of the second matrix.
If AA is of size m×nm \times n and BB is of size n×pn \times p, then their product ABAB will be of size m×pm \times p.
Example:
A=[1234],B=[5678]A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}, \quad B = \begin{bmatrix} 5 & 6 \\ 7 & 8 \end{bmatrix} AB=[(1×5+2×7)(1×6+2×8)(3×5+4×7)(3×6+4×8)]AB = \begin{bmatrix} (1 \times 5 + 2 \times 7) & (1 \times 6 + 2 \times 8) \\ (3 \times 5 + 4 \times 7) & (3 \times 6 + 4 \times 8) \end{bmatrix} AB=[5+146+1615+2818+32]=[19224350]AB = \begin{bmatrix} 5+14 & 6+16 \\ 15+28 & 18+32 \end{bmatrix} = \begin{bmatrix} 19 & 22 \\ 43 & 50 \end{bmatrix}
5. Determinant of a Matrix
The determinant is a single number that can be calculated for square matrices.
5.1 Determinant of a 2×2 Matrix
A=[abcd]A = \begin{bmatrix} a & b \\ c & d \end{bmatrix} det(A)=ad−bc\det(A) = ad – bc
Example:
A=[3425]A = \begin{bmatrix} 3 & 4 \\ 2 & 5 \end{bmatrix} det(A)=(3×5)−(4×2)=15−8=7\det(A) = (3 \times 5) – (4 \times 2) = 15 – 8 = 7
5.2 Determinant of a 3×3 Matrix
For a 3×3 matrix: A=[abcdefghi]A = \begin{bmatrix} a & b & c \\ d & e & f \\ g & h & i \end{bmatrix} det(A)=a(ei−fh)−b(di−fg)+c(dh−eg)\det(A) = a(ei – fh) – b(di – fg) + c(dh – eg)
6. Inverse of a Matrix
The inverse of a matrix AA, denoted as A−1A^{-1}, satisfies: AA−1=IA A^{-1} = I
For a 2×2 matrix: A−1=1det(A)[d−b−ca]A^{-1} = \frac{1}{\det(A)} \begin{bmatrix} d & -b \\ -c & a \end{bmatrix}
Example:
A=[3425]A = \begin{bmatrix} 3 & 4 \\ 2 & 5 \end{bmatrix} det(A)=(3×5)−(4×2)=15−8=7\det(A) = (3 \times 5) – (4 \times 2) = 15 – 8 = 7 A−1=17[5−4−23]A^{-1} = \frac{1}{7} \begin{bmatrix} 5 & -4 \\ -2 & 3 \end{bmatrix}
