Matrices | Mathematics | Knowledge Hub Matrices | Mathematics | Knowledge Hub
Unlock Premium - notes, past papers & AI tutoring for as low as KSh 199/month. Subscribe Now →
Mathematics Tutorial

Matrices

Lesson 66 of 75
4 min read Mathew Wahome

Introduction

In mathematics, matrices are rectangular arrays of numbers or symbols arranged in rows and columns. They are essential in various fields such as physics, engineering, computer science, and economics. In this topic, we will explore the basics of matrices, including operations like addition, subtraction, multiplication, and finding the inverse of a matrix.

Matrix Representation and Terminology

A matrix is denoted by a capital letter usually, like $A$, and its elements are represented by lowercase letters with subscripts. For example, an $m \times n$ matrix $A$ can be represented as: $$ A = \begin{bmatrix} a_{11} & a_{12} & \cdots & a_{1n} \ a_{21} & a_{22} & \cdots & a_{2n} \ \vdots & \vdots & \ddots & \vdots \ a_{m1} & a_{m2} & \cdots & a_{mn} \end{bmatrix} $$ where $a_{ij}$ represents the element in the $i$-th row and $j$-th column.

Example:

Consider the matrix $B = \begin{bmatrix} 2 & 4 \ 1 & 3 \end{bmatrix}$. Here, $b_{11} = 2$, $b_{12} = 4$, $b_{21} = 1$, and $b_{22} = 3$.

Matrix Addition and Subtraction

Addition and subtraction of matrices can only be performed on matrices of the same dimensions. To add or subtract two matrices, simply add or subtract corresponding elements. If $A = \begin{bmatrix} a & b \ c & d \end{bmatrix}$ and $B = \begin{bmatrix} w & x \ y & z \end{bmatrix}$, then: $$ A + B = \begin{bmatrix} a+w & b+x \ c+y & d+z \end{bmatrix} $$ $$ A - B = \begin{bmatrix} a-w & b-x \ c-y & d-z \end{bmatrix} $$

Example:

Let $C = \begin{bmatrix} 1 & 2 \ 3 & 4 \end{bmatrix}$ and $D = \begin{bmatrix} 2 & 1 \ 4 & 3 \end{bmatrix}$. Find $C + D$ and $C - D$.

Solution: $$ C + D = \begin{bmatrix} 1+2 & 2+1 \ 3+4 & 4+3 \end{bmatrix} = \begin{bmatrix} 3 & 3 \ 7 & 7 \end{bmatrix} $$ $$ C - D = \begin{bmatrix} 1-2 & 2-1 \ 3-4 & 4-3 \end{bmatrix} = \begin{bmatrix} -1 & 1 \ -1 & 1 \end{bmatrix} $$

Matrix Multiplication

Multiplication of matrices is not commutative, i.e., $AB$ is not necessarily equal to $BA$. For the product $AB$ to be defined, the number of columns in matrix $A$ must be equal to the number of rows in matrix $B$.

If $A$ is an $m \times n$ matrix and $B$ is an $n \times p$ matrix, then the product $AB$ is an $m \times p$ matrix. Each element of the resulting matrix is obtained by multiplying the elements of a row of matrix $A$ by the corresponding elements of a column of matrix $B$ and summing up the products.

Example:

Let $E = \begin{bmatrix} 1 & 2 \ 3 & 4 \end{bmatrix}$ and $F = \begin{bmatrix} 2 & 0 \ 1 & 2 \end{bmatrix}$. Find the product $EF$.

Solution: $$ \begin{aligned} EF &= \begin{bmatrix} 12 + 21 & 10 + 22 \ 32 + 41 & 30 + 42 \end{bmatrix} \ &= \begin{bmatrix} 4 & 4 \ 10 & 8 \end{bmatrix} \end{aligned} $$

Matrix Inverse

The inverse of a square matrix $A$, denoted as $A^{-1}$, is such that $AA^{-1} = A^{-1}A = I$, where $I$ is the identity matrix. Not all matrices have inverses; a matrix must be square and have a non-zero determinant to have an inverse.

Example:

Let $G = \begin{bmatrix} 1 & 2 \ 3 & 4 \end{bmatrix}$. Find the inverse of matrix $G$.

Solution: The inverse of $G$, denoted as $G^{-1}$, is calculated as: $$ G^{-1} = \frac{1}{ad-bc} \begin{bmatrix} d & -b \ -c & a \end{bmatrix} $$ where $a, b, c, d$ are elements of matrix $G$. In this case, $a=1, b=2, c=3, d=4$. Thus, $G^{-1} = \frac{1}{14 - 23} \begin{bmatrix} 4 & -2 \ -3 & 1 \end{bmatrix} = \begin{bmatrix} -2 & 1 \ 1.5 & -0.5 \end{bmatrix}$.

Common Mistakes

  1. Not Checking Matrix Dimensions: Always ensure that the dimensions of matrices are compatible for the operation being performed.

  2. Confusing Matrix Multiplication with Matrix Addition: Remember that matrix multiplication involves multiplying corresponding elements and summing them up, whereas addition involves simply adding corresponding elements.

  3. Assuming All Matrices Have Inverses: Not all matrices have inverses; make sure to check the determinant before trying to find the inverse.

Key Points

  • Matrices are rectangular arrays of numbers or symbols.
  • Addition and subtraction of matrices are done element-wise for matrices of the same dimensions.
  • Matrix multiplication requires the number of columns in the first matrix to be equal to the number of rows in the second matrix.
  • The inverse of a matrix is such that the product of the matrix and its inverse is the identity matrix.

Practice Questions

  1. Given $A = \begin{bmatrix} 2 & 3 \ 1 & 2 \end{bmatrix}$ and $B = \begin{bmatrix} 1 & 0 \ 2 & 1 \end{bmatrix}$, find $A + B$ and $A - B$.

Answer: $$ A + B = \begin{bmatrix} 2+1 & 3+0 \ 1+2 & 2+1 \end{bmatrix} = \begin{bmatrix} 3 & 3 \ 3 & 3 \end{bmatrix} $$ $$ A - B = \begin{bmatrix} 2-1 & 3-0 \ 1-2 & 2-1 \end{bmatrix} = \begin{bmatrix} 1 & 3 \ -1 & 1 \end{bmatrix} $$

  1. Let $C = \begin{bmatrix} 4 & 2 \ 3 & 1 \end{bmatrix}$ and $D = \begin{bmatrix} 1 & 2 \ 0 & 1 \end{bmatrix}$. Find $CD$.

Answer: $$ CD = \begin{bmatrix} 41 + 20 & 42 + 21 \ 31 + 10 & 32 + 11 \end{bmatrix} = \begin{bmatrix} 4 & 8 \ 3 & 7 \end{bmatrix} $$

  1. Determine if the matrix $E = \begin{bmatrix} 2 & 3 \ 4 & 5 \end{bmatrix}$ has an inverse. If it does, find the inverse.

Answer: $E$ has an inverse if its determinant is not zero. The determinant of $E$ is $25 - 34 = 10 - 12 = -2$, which is not zero. Therefore, $E$ has an inverse. To find the inverse: $$ E^{-1} = \frac{1}{25 - 34} \begin{bmatrix} 5 & -3 \ -4 & 2 \end{bmatrix} = \begin{bmatrix} -5 & 3 \ 4 & -2 \end{bmatrix} $$

  1. Given $F = \begin{bmatrix} 3 & 1 \ 2 & 4 \end{bmatrix}$ and $G = \begin{bmatrix} 0 & 2 \ 1 & 1 \end{bmatrix}$, calculate $FG$.

Answer: $$ FG = \begin{bmatrix} 30 + 11 & 32 + 11 \ 20 + 41 & 22 + 41 \end{bmatrix} = \begin{bmatrix} 1 & 7 \ 4 & 9 \end{bmatrix} $$

  1. Find the inverse of the matrix $H = \begin{bmatrix} 1 & 3 \ 2 & 5 \end{bmatrix}$.

Answer: The determinant of $H$ is $15 - 32 = 5 - 6 = -1$, which is not zero. Therefore, $H$ has an inverse. The inverse of $H$ is: $$ H^{-1} = \frac{1}{15 - 32} \begin{bmatrix} 5 & -3 \ -2 & 1 \end{bmatrix} = \begin{bmatrix} -5 & 3 \ 2 & -1 \end{bmatrix} $$

Study Assistant

Instant help with course questions

Hi there! I'm your YnetStudyHub assistant. How can I help with your studies today?