Introduction to Matrices

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:

A=(a11a12…a1na21a22…a2n⋮⋮⋱⋮am1am2…amn)A = \begin{pmatrix} a_{11} & a_{12} & \dots & a_{1n} \\ a_{21} & a_{22} & \dots & a_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ a_{m1} & a_{m2} & \dots & a_{mn} \end{pmatrix}

For example, a $2 \times 3$ matrix can be written as:

A=(a11a12a13a21a22a23)A = \begin{pmatrix} a_{11} & a_{12} & a_{13}\\ a_{21} & a_{22} & a_{23} \end{pmatrix}

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$:

A=(123456789)A = \begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{pmatrix}

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:

A=(1234),B=(5678)A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}, \quad B = \begin{pmatrix} 5 & 6 \\ 7 & 8 \end{pmatrix}

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:

C=(681012)C = \begin{pmatrix} 6 & 8 \\ 10 & 12 \end{pmatrix}

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:

C=(−4−4−4−4)C = \begin{pmatrix} -4 & -4 \\ -4 & -4 \end{pmatrix}

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$:

A=(1234)A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}

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:

C=(2468)C = \begin{pmatrix} 2 & 4 \\ 6 & 8 \end{pmatrix}

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$:

A=(123456),B=(789101112)A = \begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{pmatrix}, \quad B = \begin{pmatrix} 7 & 8 \\ 9 & 10 \\ 11 & 12 \end{pmatrix}

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:

C=(5864139154)C = \begin{pmatrix} 58 & 64 \\ 139 & 154 \end{pmatrix}

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:

A=(123456)A = \begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{pmatrix}

The transpose of $A$, denoted as $A^T$, will be:

AT=(142536)A^T = \begin{pmatrix} 1 & 4 \\ 2 & 5 \\ 3 & 6 \end{pmatrix}

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:

A=(1234)A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}

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:

A=(1234)A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}

The inverse of matrix $A$, denoted $A^{-1}$, is:

A−1=1det(A)⋅(a22−a12−a21a11)A^{-1} = \frac{1}{\text{det}(A)} \cdot \begin{pmatrix} a_{22} & -a_{12} \\ -a_{21} & a_{11} \end{pmatrix}

For $A$, the determinant is:

$$
\text{det}(A) = (1 \cdot 4) – (2 \cdot 3) = -2
$$

Thus, the inverse of $A$ is:

A−1=1−2⋅(4−2−31)=(−211.5−0.5)A^{-1} = \frac{1}{-2} \cdot \begin{pmatrix} 4 & -2 \\ -3 & 1 \end{pmatrix} = \begin{pmatrix} -2 & 1 \\ 1.5 & -0.5 \end{pmatrix}

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:

A=(1236)A = \begin{pmatrix} 1 & 2 \\ 3 & 6 \end{pmatrix}

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:

B=(4321)B = \begin{pmatrix} 4 & 3 \\ 2 & 1 \end{pmatrix}

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

Scroll to Top