Matrices
By the end of this lesson, you’ll be able to:
- Represent data and transformations using matrices.
- Add, subtract, and scale matrices.
- Multiply matrices (row-by-column).
- Interpret matrices in systems, transformations, and data contexts.
Key Ideas
A matrix is a rectangular array of numbers.
Example of a \(2 \times 3\) matrix: \[ \begin{bmatrix} 1 & 4 & 2 \\ 3 & 0 & 5 \end{bmatrix} \]
Dimensions: rows × columns
- Row 1: \([1,\;4,\;2]\)
- Row 2: \([3,\;0,\;5]\)
Operations:
Addition/Subtraction: elementwise, only for same-size matrices
\[ A + B = (a_{ij} + b_{ij}) \]Scalar Multiplication: multiply each entry
\[ kA = (ka_{ij}) \]Matrix Multiplication: row-by-column
\[ (AB)_{ij} = \text{Row}_i(A) \cdot \text{Column}_j(B) \]
Multiplication is not commutative: \[ AB \ne BA \]
Common Problem Types
Adding or Subtracting Matrices
Only possible when dimensions match.
Example:
\[
\begin{bmatrix}
1 & 2\\
3 & 4
\end{bmatrix}
+
\begin{bmatrix}
5 & 1\\
0 & -2
\end{bmatrix}
=
\begin{bmatrix}
6 & 3\\
3 & 2
\end{bmatrix}
\]
Scalar Multiplication
Multiply each element.
Example:
\[
2
\begin{bmatrix}
3 & -1\\
4 & 2
\end{bmatrix}
=
\begin{bmatrix}
6 & -2\\
8 & 4
\end{bmatrix}
\]
Matrix Multiplication (Row-by-Column)
Multiply rows of first by columns of second.
Example:
\[
\begin{bmatrix}
1 & 2
\end{bmatrix}
\begin{bmatrix}
3\\
4
\end{bmatrix}
=
1(3) + 2(4) = 11
\]
Interpreting Matrices in Systems
A matrix can represent a system of linear equations.
Example: \[ \begin{bmatrix} 2 & 1\\ 3 & -1 \end{bmatrix} \begin{bmatrix} x\\ y \end{bmatrix} = \begin{bmatrix} 5\\ 4 \end{bmatrix} \]
Represents: - \(2x + y = 5\)
- \(3x - y = 4\)
Data Tables → Matrices
Matrices often store information like:
| Item | Price | Quantity |
|---|---|---|
| A | 3 | 4 |
| B | 5 | 2 |
Matrix form: \[ \begin{bmatrix} 3 & 4\\ 5 & 2 \end{bmatrix} \]
Strategies
- Check dimensions before multiplying.
- Use row-by-column carefully — rewrite rows/columns if needed.
- Matrix multiplication often encodes compositions of transformations.
- For systems: rows correspond to equations; columns correspond to variables.
- When stuck, write out one entry at a time.
Worked Examples
Example 1 — Add matrices
Compute: \[ \begin{bmatrix} 4 & -1\\ 2 & 3 \end{bmatrix} + \begin{bmatrix} 1 & 5\\ 0 & -4 \end{bmatrix} \]
Solution: \[ \begin{bmatrix} 5 & 4\\ 2 & -1 \end{bmatrix} \]
Example 2 — Scalar multiplication
Compute: \[ -3 \begin{bmatrix} 2 & -2\\ 1 & 4 \end{bmatrix} \]
Solution: \[ \begin{bmatrix} -6 & 6\\ -3 & -12 \end{bmatrix} \]
Example 3 — Multiply matrices
Compute: \[ \begin{bmatrix} 2 & 1\\ 1 & 3 \end{bmatrix} \begin{bmatrix} 4 & 0\\ -2 & 5 \end{bmatrix} \]
Work:
First row × first column: \[ 2(4) + 1(-2) = 6 \]
First row × second column: \[ 2(0) + 1(5) = 5 \]
Second row × first column: \[ 1(4) + 3(-2) = -2 \]
Second row × second column: \[ 1(0) + 3(5) = 15 \]
Final result: \[ \begin{bmatrix} 6 & 5\\ -2 & 15 \end{bmatrix} \]
Example 4 — System as a matrix
System: - \(3x + y = 11\)
- \(x - 2y = -3\)
Matrix form: \[ \begin{bmatrix} 3 & 1\\ 1 & -2 \end{bmatrix} \begin{bmatrix} x\\ y \end{bmatrix} = \begin{bmatrix} 11\\ -3 \end{bmatrix} \]
- Trying to multiply matrices with incompatible dimensions.
- Using element-by-element multiplication instead of row-by-column.
- Forgetting that \(AB \ne BA\).
- Mixing up rows and columns when forming system matrices.
- Arithmetic errors in multi-step multiplications.
Practice Problems
- Add:
$$ \[\begin{bmatrix} 1 & 2\\ 3 & 4 \end{bmatrix}\]
- \[\begin{bmatrix} 4 & 0\\ -1 & 5 \end{bmatrix}\] $$
Scalar multiply:
\[ 5 \begin{bmatrix} -2 & 3\\ 1 & 4 \end{bmatrix} \]Multiply:
\[ \begin{bmatrix} 1 & -1\\ 2 & 3 \end{bmatrix} \begin{bmatrix} 4\\ 5 \end{bmatrix} \]Write the system represented by:
\[ \begin{bmatrix} 2 & 3\\ -1 & 4 \end{bmatrix} \begin{bmatrix} x\\ y \end{bmatrix} = \begin{bmatrix} 7\\ 10 \end{bmatrix} \]
1.
\[
\begin{bmatrix}
5 & 2\\
2 & 9
\end{bmatrix}
\]
2.
\[
\begin{bmatrix}
-10 & 15\\
5 & 20
\end{bmatrix}
\]
3.
Compute row-by-column:
\[
\langle 1,-1 \rangle \cdot \langle 4,5 \rangle = 1(4) + (-1)(5) = -1
\]
\[
\langle 2,3 \rangle \cdot \langle 4,5 \rangle = 2(4) + 3(5) = 23
\]
Answer: \[ \begin{bmatrix} -1\\ 23 \end{bmatrix} \]
4.
System:
\(2x + 3y = 7\)
\(-x + 4y = 10\)
Summary
- Matrices store data and represent transformations.
- Add/subtract elementwise; multiply row-by-column.
- Dimensions must be compatible for multiplication.
- Systems of equations can be written in matrix form.
- Dimensions multiply like: \((m \times n)(n \times p)\).
- If unsure, compute one entry at a time.
- Matrix multiplication → composition of transformations.
- Watch for sign errors.