MathMastery.Beta
Learning Resources

Matrices

Interactive curriculum lessons, worked examples, and geometric problem-solving techniques designed to help Kenyan students master CBC, KPSEA, KCSE, and IGCSE mathematics.

N/A Pathway: N/A

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

Example 1 (Easy): Basic Matrix Addition & Scalar Multiplication

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} \).

  1. 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} \]
  2. 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} \]
Example 2 (Medium): Matrix Multiplication \( (2 \times 2) \times (2 \times 2) \)

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} \).

  1. Row 1 \(\times\) Column 1: \( (2)(5) + (3)(1) = 10 + 3 = 13 \)
  2. Row 1 \(\times\) Column 2: \( (2)(-2) + (3)(0) = -4 + 0 = -4 \)
  3. Row 2 \(\times\) Column 1: \( (-1)(5) + (4)(1) = -5 + 4 = -1 \)
  4. Row 2 \(\times\) Column 2: \( (-1)(-2) + (4)(0) = 2 + 0 = 2 \)
  5. Combine results: \[ \mathbf{PQ} = \begin{bmatrix} 13 & -4 \\ -1 & 2 \end{bmatrix} \]
Example 3 (Hard): Finding Matrix Inverse & Area Transformation

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.

  1. Step 1: Calculate \( \det(\mathbf{M}) \): \[ \det(\mathbf{M}) = (4)(2) - (2)(3) = 8 - 6 = 2 \]
  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} \]
  3. 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

Misconception 1: Multiplying matrices element-by-element

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.

Misconception 2: Assuming \( AB = BA \) (Commutativity)

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.

Misconception 3: Sign error in \( 2 \times 2 \) inverse

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

Agribusiness Inventory & Revenue: Tea and coffee cooperatives in Kericho and Mount Kenya use matrices to compute monthly revenue. Multiplying a production quantity matrix \((1 \times 3)\) by a unit price vector \((3 \times 1)\) instantly yields total revenue across multiple grade varieties.
Telecommunications & M-Pesa Networks: Telecom providers like Safaricom model packet routing and signal transfers across Kenyan cell towers using adjacency matrices.
Computer Graphics & Animation: 2D and 3D video game engines render game assets on smartphone screens using transformation matrices to scale, rotate, and project shapes continuously at 60 frames per second.

Practice

Given the matrix \(A = \begin{pmatrix} 3 & 5 \\ 2 & -4 \end{pmatrix}\), calculate its determinant. (Type only the number, e.g., -15)
Review the concepts above.
If matrix \(P = \begin{pmatrix} 7 & -3 \\ 4 & 5 \end{pmatrix}\) and \(Q = 4P\), find the value of the element in row 1, column 2 of matrix \(Q\). (Type only the number, e.g., -12)
Review the concepts above.
Given the matrices \(A = \begin{bmatrix} 2 & -1 \\ 3 & 4 \end{bmatrix}\) and \(B = \begin{bmatrix} 1 & 5 \\ 0 & -2 \end{bmatrix}\), calculate the element in the first row and second column of the product matrix \(AB\). (Type only the number, e.g., 12)
Review the concepts above.
Given the matrices \(A = \begin{bmatrix} 2 & -1 \\ 3 & 4 \end{bmatrix}\) and \(B = \begin{bmatrix} 1 & 5 \\ 0 & 2 \end{bmatrix}\), find the element in the second row, first column of the product matrix \(AB\). (Type only the number, e.g., 3)
Review the concepts above.
A singular matrix has a determinant of 0. If matrix \(M = \begin{pmatrix} k & 6 \\ 2 & 3 \end{pmatrix}\) is singular, find the value of \(k\). (Type only the number, e.g., 4)
Review the concepts above.
A triangle with an area of \(6\text{ cm}^2\) is transformed by the matrix \(T = \begin{pmatrix} 4 & 1 \\ 2 & 3 \end{pmatrix}\). Calculate the area of the transformed triangle in \(\text{cm}^2\). (Type only the number, e.g., 60)
Review the concepts above.