Definition of a Matrix
A matrix is a rectangular array of numbers or symbols arranged in rows and columns. Matrices are typically denoted by capital letters such as $A$, $B$, $C$, etc. The elements of the matrix are often represented as $a_{ij}$, where $i$ is the row number and $j$ is the column number.
General Representation
A matrix $A$ of size $m \times n$ (with $m$ rows and $n$ columns) is written as:
For example, a $2 \times 3$ matrix can be written as:
Square Matrix
A square matrix is a matrix that has the same number of rows and columns. If $A = [a_{ij}]$ is a square matrix, it has size $n \times n$, meaning $m = n$.
Formally:
Example:
The following is a square matrix of size $3 \times 3$:
In this example, the matrix has 3 rows and 3 columns, so it is square.
Matrix Operations
1. Matrix Addition
Matrix addition is performed by adding corresponding elements of two matrices. If $A = [a_{ij}]$ and $B = [b_{ij}]$ are two matrices of the same size, then the sum matrix $C = A + B$ will have the elements $c_{ij}$ given by:
$$
c_{ij} = a_{ij} + b_{ij}
$$
Example:
Let’s add two $2 \times 2$ matrices:
The sum $C = A + B$ is:
$$
c_{11} = 1 + 5, \quad c_{12} = 2 + 6, \quad c_{21} = 3 + 7, \quad c_{22} = 4 + 8
$$
Thus, we get:
2. Matrix Subtraction
Matrix subtraction is performed element-wise in the same way as matrix addition. If $A = [a_{ij}]$ and $B = [b_{ij}]$ are two matrices of the same size, then the difference matrix $C = A – B$ will have the elements $c_{ij}$ given by:
$$
c_{ij} = a_{ij} – b_{ij}
$$
Example:
For the same matrices $A$ and $B$, the difference $C = A – B$ is:
$$
c_{11} = 1 – 5, \quad c_{12} = 2 – 6, \quad c_{21} = 3 – 7, \quad c_{22} = 4 – 8
$$
Thus, we get:
3. Scalar Multiplication
Scalar multiplication involves multiplying each element of the matrix by a scalar $\alpha$. If $A = [a_{ij}]$ is a matrix and $\alpha$ is a scalar, then the scalar product matrix $C = \alpha A$ will have elements $c_{ij}$ given by:
$$
c_{ij} = \alpha \cdot a_{ij}
$$
Example:
For $\alpha = 2$ and matrix $A$:
The scalar multiplication $C = 2A$ is:
$$
c_{11} = 2 \times 1, \quad c_{12} = 2 \times 2, \quad c_{21} = 2 \times 3, \quad c_{22} = 2 \times 4
$$
Thus, we get:
4. Matrix Multiplication
Matrix multiplication can be done when the number of columns in the first matrix is equal to the number of rows in the second matrix. If $A$ is a $m \times n$ matrix and $B$ is a $n \times p$ matrix, then the product matrix $C = AB$ is an $m \times p$ matrix where each element $c_{ij}$ is given by:
$$
c_{ij} = \sum_{k=1}^{n} a_{ik} \cdot b_{kj}
$$
Example:
Let’s multiply two matrices $A = 2 \times 3$ and $B = 3 \times 2$:
The product $C = AB$ is:
$$
c_{11} = 1 \times 7 + 2 \times 9 + 3 \times 11, \quad c_{12} = 1 \times 8 + 2 \times 10 + 3 \times 12
$$
$$
c_{21} = 4 \times 7 + 5 \times 9 + 6 \times 11, \quad c_{22} = 4 \times 8 + 5 \times 10 + 6 \times 12
$$
Thus, we get:
5. Transpose of a Matrix
The transpose of a matrix $A = [a_{ij}]$ is a new matrix, denoted as $A^T$, obtained by swapping the rows and columns of $A$. That is, the element at the $i$-th row and $j$-th column of $A$ becomes the element at the $j$-th row and $i$-th column in $A^T$.
Formally:
$$
A^T = [a_{ji}]
$$
This means:
$$
a_{ij} \longrightarrow a_{ji}
$$
Example:
Let $A$ be the matrix:
The transpose of $A$, denoted as $A^T$, will be:
Notice that the first row of $A$ becomes the first column of $A^T$, and the second row of $A$ becomes the second column of $A^T$.
6. Determinant of a Square Matrix
The determinant of a square matrix $A = [a_{ij}]$ is a scalar value that can be computed from the elements of $A$. The determinant of a $2 \times 2$ matrix is given by:
$$
\text{det}(A) = a_{11} \cdot a_{22} – a_{12} \cdot a_{21}
$$
For a $3 \times 3$ matrix, the determinant is computed as:
$$
\text{det}(A) = a_{11} \cdot (a_{22} \cdot a_{33} – a_{23} \cdot a_{32}) – a_{12} \cdot (a_{21} \cdot a_{33} – a_{23} \cdot a_{31}) + a_{13} \cdot (a_{21} \cdot a_{32} – a_{22} \cdot a_{31})
$$
Example:
For the $2 \times 2$ matrix:
The determinant of $A$ is:
$$
\text{det}(A) = (1 \cdot 4) – (2 \cdot 3) = 4 – 6 = -2
$$
7. Inverse of a Matrix
The inverse of a matrix $A$, denoted as $A^{-1}$, is the matrix such that:
$$
A \cdot A^{-1} = A^{-1} \cdot A = I_n
$$
Where $I_n$ is the identity matrix of size $n \times n$. Not all matrices have an inverse. A matrix must be non-singular (i.e., its determinant is non-zero) to have an inverse.
The elements of the inverse matrix $A^{-1} = [b_{ij}]$ satisfy:
$$
A \cdot A^{-1} = I_n
$$
Example:
Consider the matrix:
The inverse of matrix $A$, denoted $A^{-1}$, is:
For $A$, the determinant is:
$$
\text{det}(A) = (1 \cdot 4) – (2 \cdot 3) = -2
$$
Thus, the inverse of $A$ is:
8. Singular and Non-Singular Matrices
- A matrix is non-singular (or invertible) if its determinant is non-zero, i.e., $\text{det}(A) \neq 0$. Non-singular matrices have an inverse.
- A matrix is singular if its determinant is zero, i.e., $\text{det}(A) = 0$. Singular matrices do not have an inverse.
Example:
- For the matrix:
The determinant of $A$ is:
$$
\text{det}(A) = (1 \cdot 6) – (2 \cdot 3) = 6 – 6 = 0
$$
Since $\text{det}(A) = 0$, matrix $A$ is singular and does not have an inverse.
On the other hand, for the matrix:
The determinant of $B$ is:
$$
\text{det}(B) = (4 \cdot 1) – (3 \cdot 2) = 4 – 6 = -2
$$
Since $\text{det}(B) \neq 0$, matrix $B$ is non-singular and has an inverse.
Next: Various Types of Matrix