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
(a) Concrete Scenario: The Duka Stock Sheet
Imagine Mama Sarah runs two general stores (dukas)—one in Nairobi and one in Nakuru. She sells two main items: Bags of Maize Flour (Unga) and Jerrycans of Cooking Oil.
Instead of writing long sentences, she arranges her weekly sales in a neat grid:
When Week 2 ends, she has a second grid. To calculate her total bi-weekly sales, she simply adds the numbers in the matching store and item slots! This rectangular table of numbers is called a matrix.
Interactive Matrix Addition Lab
Change any value in Matrix \(A\) or Matrix \(B\) to watch how corresponding elements instantly sum in Matrix \(C\).
A matrix is defined by its order (or dimensions): \(m \times n\), meaning \(m\) rows (horizontal) and \(n\) columns (vertical). Just as you cannot stack an egg crate holding 6 eggs onto a 12-egg crate without spilling, you cannot add or subtract two matrices unless their dimensions are identical.
Given matrices \(A = [a_{ij}]\) and \(B = [b_{ij}]\) of dimension \(m \times n\), their sum \(C = A + B\) and difference \(D = A - B\) are formed by operating on corresponding elements:
\[c_{ij} = a_{ij} + b_{ij} \quad \text{and} \quad d_{ij} = a_{ij} - b_{ij}\]Key Formulas
1. Order (Dimensions) of a Matrix
\[A_{m \times n} = \begin{bmatrix} 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{bmatrix}\]Always state Rows first, then Columns (\(R \times C\)).
2. Matrix Addition & Subtraction
\[\begin{bmatrix} a & b \\ c & d \end{bmatrix} + \begin{bmatrix} e & f \\ g & h \end{bmatrix} = \begin{bmatrix} a+e & b+f \\ c+g & d+h \end{bmatrix}\]\[\begin{bmatrix} a & b \\ c & d \end{bmatrix} - \begin{bmatrix} e & f \\ g & h \end{bmatrix} = \begin{bmatrix} a-e & b-f \\ c-g & d-h \end{bmatrix}\]Condition: Dimensions of both matrices must be strictly equal.
3. Determinant of a \(2 \times 2\) Matrix
\[\det(A) = |A| = \begin{vmatrix} a & b \\ c & d \end{vmatrix} = (ad) - (bc)\]Product of main diagonal minus product of anti-diagonal.
Worked Examples
Example 1: Direct Matrix Addition
Calculate \(A + B\) given:
\[A = \begin{bmatrix} 5 & -2 \\ 3 & 7 \end{bmatrix}, \quad B = \begin{bmatrix} 4 & 6 \\ -1 & 2 \end{bmatrix}\]- Check dimensions: Both \(A\) and \(B\) are \(2 \times 2\). Addition is valid.
- Add corresponding elements: \[A + B = \begin{bmatrix} 5 + 4 & -2 + 6 \\ 3 + (-1) & 7 + 2 \end{bmatrix}\]
- Simplify each entry: \[A + B = \begin{bmatrix} 9 & 4 \\ 2 & 9 \end{bmatrix}\]
Example 2: Subtraction with Negatives
If \(P = \begin{bmatrix} 10 & 3 \\ -4 & 8 \end{bmatrix}\) and \(Q = \begin{bmatrix} 6 & -5 \\ 2 & 11 \end{bmatrix}\), find \(P - Q\).
- Subtract each element of \(Q\) from the corresponding element in \(P\): \[P - Q = \begin{bmatrix} 10 - 6 & 3 - (-5) \\ -4 - 2 & 8 - 11 \end{bmatrix}\]
- Apply integer rules (e.g., \(3 - (-5) = 3 + 5 = 8\)): \[P - Q = \begin{bmatrix} 4 & 8 \\ -6 & -3 \end{bmatrix}\]
Example 3: Solving a Matrix Equation
Find the matrix \(X\) that satisfies the equation:
\[X + \begin{bmatrix} 3 & -1 \\ 4 & 7 \end{bmatrix} = \begin{bmatrix} 8 & 5 \\ 1 & 2 \end{bmatrix}\]- Isolate \(X\) by subtracting the known matrix from both sides: \[X = \begin{bmatrix} 8 & 5 \\ 1 & 2 \end{bmatrix} - \begin{bmatrix} 3 & -1 \\ 4 & 7 \end{bmatrix}\]
- Compute each element: \(x_{11} = 8 - 3 = 5\), \(x_{12} = 5 - (-1) = 6\), \(x_{21} = 1 - 4 = -3\), \(x_{22} = 2 - 7 = -5\).
- Conclusion: \[X = \begin{bmatrix} 5 & 6 \\ -3 & -5 \end{bmatrix}\]
Common Mistakes
Misconception 1: Adding Incompatible Matrix Dimensions
The Mistake: Trying to add \(\begin{bmatrix} 2 & 3 \\ 1 & 4 \end{bmatrix} + \begin{bmatrix} 5 & 6 \end{bmatrix}\).
Why it feels right: Learners want to add the top row numbers together and leave the remaining numbers as they are.
The Correction: Matrix addition is strictly defined only when both matrices have the identical order (\(m \times n\)). If sizes differ, the sum is undefined.
Misconception 2: Double Negative Confusion in Subtraction
The Mistake: When calculating \(\begin{bmatrix} 4 \end{bmatrix} - \begin{bmatrix} -7 \end{bmatrix}\), writing \(-3\) or \(3\).
Why it feels right: Seeing minus signs makes learners instinctively subtract \(4 - 7\).
The Correction: Always write out the double sign: \(4 - (-7) = 4 + 7 = 11\).
Misconception 3: Confusing Determinant with Subtraction
The Mistake: Calculating \(\det(A)\) by doing \(a_{11} - a_{22}\) instead of \((ad) - (bc)\).
The Correction: The determinant of \(\begin{bmatrix} a & b \\ c & d \end{bmatrix}\) is the difference of diagonal products: \(ad - bc\).
Real World
1. Agri-Business Supply Logistics in Kenya
A cooperative in Eldoret tracks milk distribution (in thousands of liters) to two creameries (Brookside & KCC) over two weeks:
Total supply over the fortnight is given by \(W_1 + W_2 = \begin{bmatrix} 40 & 27 \\ 30 & 20 \end{bmatrix}\). This helps the SACCO manage payout allocations instantly!
2. Computer Graphics & Screen Pixels
Every digital image on a smartphone or computer screen is a matrix of pixel values (Red, Green, Blue). Applying a filter or adjusting brightness is done by adding or subtracting constant values across the image matrix!
Practice