Matrices
Interactive curriculum lessons, worked examples, and geometric problem-solving techniques designed to help Kenyan students master CBC, KPSEA, KCSE, and IGCSE mathematics.
First Principles
Concrete Scenario: Duka Stock Tracking
Imagine Mama Sarah operates two shop branches in Nairobi and Mombasa selling bags of Maize and Beans. We can record her stock in a rectangular table (a matrix):
\(\mathbf{S} = \begin{bmatrix} 120 & 85 \\ 90 & 60 \end{bmatrix} \begin{matrix} \text{Maize} \\ \text{Beans} \end{matrix}\)
Here, rows represent items and columns represent branches. Matrices allow us to organize data compactly and transform spatial coordinates simultaneously.
1. Matrix Order and Structure
A matrix of order \(m \times n\) has \(m\) horizontal rows and \(n\) vertical columns. An entry \(a_{ij}\) represents the value at row \(i\) and column \(j\).
2. Matrices as Geometric Transformations
Every \(2 \times 2\) matrix \(\begin{bmatrix} a & b \\ c & d \end{bmatrix}\) acts as a geometric function transforming coordinate vectors \(\begin{bmatrix} x \\ y \end{bmatrix}\) into new positions \(\begin{bmatrix} x' \\ y' \end{bmatrix}\):
\[ \begin{bmatrix} x' \\ y' \end{bmatrix} = \begin{bmatrix} a & b \\ c & d \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} ax + by \\ cx + dy \end{bmatrix} \]
Interactive 2D Transformation Visualizer
Adjust the matrix entries below to see how the unit square transforms on the Cartesian grid in real time:
Key Formulas
1. Matrix Addition & Subtraction
\[ \begin{bmatrix} a & b \\ c & d \end{bmatrix} \pm \begin{bmatrix} e & f \\ g & h \end{bmatrix} = \begin{bmatrix} a \pm e & b \pm f \\ c \pm g & d \pm h \end{bmatrix} \]Condition: Matrices must have identical dimensions.
2. Scalar Multiplication
\[ k \begin{bmatrix} a & b \\ c & d \end{bmatrix} = \begin{bmatrix} ka & kb \\ kc & kd \end{bmatrix} \]Every individual element is multiplied by scalar \(k\).
3. Matrix Multiplication (Row by Column)
\[ \begin{bmatrix} a & b \\ c & d \end{bmatrix} \begin{bmatrix} e & f \\ g & h \end{bmatrix} = \begin{bmatrix} ae+bg & af+bh \\ ce+dg & cf+dh \end{bmatrix} \]Defined only when the number of columns in matrix 1 equals the number of rows in matrix 2 (\(m \times p\) multiplied by \(p \times n\) gives \(m \times n\)). Note: \(AB \neq BA\) in general.
4. Determinant of a \(2 \times 2\) Matrix
\[ \det(\mathbf{A}) = |\mathbf{A}| = ad - bc \quad \text{for} \quad \mathbf{A} = \begin{bmatrix} a & b \\ c & d \end{bmatrix} \]Geometric meaning: \(|\det(\mathbf{A})|\) is the area scale factor of the 2D transformation.
5. Inverse of a \(2 \times 2\) Matrix
\[ \mathbf{A}^{-1} = \frac{1}{\det(\mathbf{A})} \begin{bmatrix} d & -b \\ -c & a \end{bmatrix} = \frac{1}{ad-bc} \begin{bmatrix} d & -b \\ -c & a \end{bmatrix} \]The inverse exists if and only if \(\det(\mathbf{A}) \neq 0\). If \(\det(\mathbf{A}) = 0\), the matrix is called singular.
Worked Examples
Given \( \mathbf{A} = \begin{bmatrix} 3 & -2 \\ 4 & 1 \end{bmatrix} \) and \( \mathbf{B} = \begin{bmatrix} 5 & 6 \\ -1 & 2 \end{bmatrix} \), calculate \( 2\mathbf{A} + \mathbf{B} \).
- Scale matrix \(\mathbf{A}\) by 2: \[ 2\mathbf{A} = 2\begin{bmatrix} 3 & -2 \\ 4 & 1 \end{bmatrix} = \begin{bmatrix} 6 & -4 \\ 8 & 2 \end{bmatrix} \]
- Add the corresponding entries of \(2\mathbf{A}\) and \(\mathbf{B}\): \[ 2\mathbf{A} + \mathbf{B} = \begin{bmatrix} 6+5 & -4+6 \\ 8+(-1) & 2+2 \end{bmatrix} = \begin{bmatrix} 11 & 2 \\ 7 & 4 \end{bmatrix} \]
Given \( \mathbf{P} = \begin{bmatrix} 2 & 3 \\ -1 & 4 \end{bmatrix} \) and \( \mathbf{Q} = \begin{bmatrix} 5 & -2 \\ 1 & 0 \end{bmatrix} \), calculate the product matrix \( \mathbf{PQ} \).
- Row 1 \(\times\) Column 1: \( (2)(5) + (3)(1) = 10 + 3 = 13 \)
- Row 1 \(\times\) Column 2: \( (2)(-2) + (3)(0) = -4 + 0 = -4 \)
- Row 2 \(\times\) Column 1: \( (-1)(5) + (4)(1) = -5 + 4 = -1 \)
- Row 2 \(\times\) Column 2: \( (-1)(-2) + (4)(0) = 2 + 0 = 2 \)
- Combine results: \[ \mathbf{PQ} = \begin{bmatrix} 13 & -4 \\ -1 & 2 \end{bmatrix} \]
Matrix \( \mathbf{M} = \begin{bmatrix} 4 & 2 \\ 3 & 2 \end{bmatrix} \) represents a transformation applied to a triangle of area \( 7\text{ cm}^2 \).
(a) Find \( \mathbf{M}^{-1} \).
(b) Calculate the area of the transformed triangle.
- Step 1: Calculate \( \det(\mathbf{M}) \): \[ \det(\mathbf{M}) = (4)(2) - (2)(3) = 8 - 6 = 2 \]
- Step 2: Form the adjugate matrix and multiply by \( \frac{1}{\det(\mathbf{M})} \): \[ \mathbf{M}^{-1} = \frac{1}{2} \begin{bmatrix} 2 & -2 \\ -3 & 4 \end{bmatrix} = \begin{bmatrix} 1 & -1 \\ -1.5 & 2 \end{bmatrix} \]
- Step 3: Calculate the transformed area: \[ \text{Transformed Area} = \text{Original Area} \times |\det(\mathbf{M})| = 7 \times 2 = 14\text{ cm}^2 \]
Common Mistakes
Correction: Matrix multiplication is not \(\begin{bmatrix} a & b \\ c & d \end{bmatrix} \begin{bmatrix} e & f \\ g & h \end{bmatrix} = \begin{bmatrix} ae & bf \\ cg & dh \end{bmatrix}\). It requires the row-by-column dot product.
Why it feels right: Addition and scalar multiplication work entry-by-entry, so intuition suggests multiplication should follow the same pattern.
Correction: Matrix multiplication is generally non-commutative. In most cases, \( AB \neq BA \). Changing the order often results in an entirely different matrix or an undefined operation.
Why it feels right: Real number arithmetic is commutative (\(3 \times 5 = 5 \times 3\)), leading students to assume algebraic structures always commute.
Correction: For \( \begin{bmatrix} a & b \\ c & d \end{bmatrix} \), swap the main diagonal entries (\(a\) and \(d\)) and change the signs of the off-diagonal entries (\(-b\) and \(-c\)). Do not swap \(b\) and \(c\).
Why it feels right: It is easy to accidentally transpose the off-diagonal entries or forget to swap the leading diagonal elements.
Real World
Practice