Matrices
Foundations & Operations
Master the language of rectangular arrays: how to organize data, perform arithmetic, and unlock systems of equations with matrix algebra.
What Is a Matrix?
A matrix is a rectangular array of numbers arranged in rows (horizontal) and columns (vertical). We describe its size as \( m \times n \), where \( m \) is the number of rows and \( n \) is the number of columns.
Types of Matrices
Why Do Matrices Matter?
Matrices are everywhere: they encode systems of linear equations, represent transformations in geometry, organize data in statistics, and power algorithms in computer science.
Addition & Subtraction
To add or subtract two matrices, they must have the same dimensions. Then simply add (or subtract) corresponding elements:
Scalar Multiplication
Multiply every element of a matrix by the same scalar constant \( k \):
Matrix Multiplication Rule
To multiply \( A_{m \times \color{#818cf8}{n}} \) by \( B_{\color{#818cf8}{n} \times p} \), the inner dimensions must match. The result is an \( m \times p \) matrix.
Commutative or Not?
Matrix addition is commutative (\( A + B = B + A \)), but matrix multiplication is not.
| Addition | Multiplication | |
|---|---|---|
| Commutative | ✓ \( A + B = B + A \) | ✕ \( AB \neq BA \) in general |
| Associative | ✓ \( (A+B)+C = A+(B+C) \) | ✓ \( (AB)C = A(BC) \) |
| Distributive | ✓ \( A(B+C) = AB + AC \) | |
| Identity element | Zero matrix \( O \) | Identity matrix \( I \) |
The Determinant of a \( 2 \times 2 \) Matrix
For a \( 2 \times 2 \) matrix \( A = \begin{bmatrix} a & b \\ c & d \end{bmatrix} \), the determinant is:
If \( \det(A) = 0 \), the matrix is singular and has no inverse.
The Inverse of a \( 2 \times 2 \) Matrix
If \( \det(A) \neq 0 \), the inverse \( A^{-1} \) exists and satisfies \( A \cdot A^{-1} = I \).
Solving Systems with Matrices
A system of equations can be written as \( A\mathbf{x} = \mathbf{b} \). If \( A^{-1} \) exists, the solution is \( \mathbf{x} = A^{-1}\mathbf{b} \).
Example 1: Matrix Addition
Find \( A + B \) where \( A = \begin{bmatrix} 4 & -2 \\ 1 & 7 \end{bmatrix} \) and \( B = \begin{bmatrix} -3 & 5 \\ 6 & -1 \end{bmatrix} \).
Example 2: Matrix Multiplication
Find \( AB \) where \( A = \begin{bmatrix} 1 & 3 \\ 2 & 0 \end{bmatrix} \) and \( B = \begin{bmatrix} 4 & -1 \\ 2 & 5 \end{bmatrix} \).
Example 3: Solving a System
Solve using matrices: \( 3x + 2y = 16 \) and \( x - y = 2 \).
Common Mistakes
Operations Summary
| Operation | Rule | Result Size |
|---|---|---|
| Addition / Subtraction | Add/subtract corresponding entries | Same as inputs |
| Scalar Multiplication | Multiply every entry by \( k \) | Same as input |
| Matrix Multiplication | Dot product of rows and columns | \( m \times p \) |
| Determinant (\( 2 \times 2 \)) | \( ad - bc \) | Scalar |
| Inverse (\( 2 \times 2 \)) | Swap, negate, divide by det | Same as input |
Question 1 of 5
If \( A \) is a \( 3 \times 4 \) matrix and \( B \) is a \( 4 \times 2 \) matrix, what are the dimensions of \( AB \)?
Question 2 of 5
What is the determinant of \( \begin{bmatrix} 5 & 3 \\ 2 & 4 \end{bmatrix} \)?
Question 3 of 5
Which property does not hold for matrix multiplication?
Question 4 of 5
Find the inverse of \( A = \begin{bmatrix} 2 & 1 \\ 5 & 3 \end{bmatrix} \).
Question 5 of 5
If \( A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} \) and \( B = \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix} \), what is the element in row 1, column 1 of \( AB \)?