Introduction to Matrices
Learn matrix notation, dimensions, and basic operations: addition, subtraction, and scalar multiplication.
What is a Matrix?
Matrix: Rectangular array of numbers arranged in rows and columns
Notation: Usually capital letters (A, B, C)
Example:
A = [2 3]
[4 5]
[6 7]
Elements: Individual numbers in the matrix
Entry notation: aᵢⱼ = element in row i, column j
Matrix Dimensions
Dimension: rows × columns (read "m by n")
Written as: m × n matrix
Example dimensions:
[1 2 3] 2×3 matrix (2 rows, 3 columns)
[4 5 6]
[1 2] 3×2 matrix (3 rows, 2 columns)
[3 4]
[5 6]
[7] 3×1 matrix (column vector)
[8]
[9]
Example: Identify Dimensions
Matrix A:
[1 0 -2 5]
[3 1 4 0]
[6 2 1 3]
Dimensions: 3 × 4 (3 rows, 4 columns)
Special Types of Matrices
Square matrix: Same number of rows and columns (n × n)
Row matrix: 1 × n (single row)
Column matrix: m × 1 (single column)
Zero matrix: All entries are 0
Examples
Square matrix (2×2):
[3 1]
[4 2]
Row matrix (1×4):
[5 -1 0 3]
Column matrix (3×1):
[2]
[7]
[4]
Zero matrix (2×3):
[0 0 0]
[0 0 0]
Accessing Elements
Entry aᵢⱼ: Row i, column j
Example: Find Specific Entries
Matrix B:
[5 2 -1]
[3 0 4]
[-2 6 1]
Find b₁₂: Row 1, column 2 = 2
Find b₃₁: Row 3, column 1 = -2
Find b₂₃: Row 2, column 3 = 4
Matrix Equality
Two matrices are equal if:
- Same dimensions
- All corresponding entries are equal
Example: Equal Matrices
Are these equal?
A = [1 2] B = [1 2]
[3 4] [3 4]
Yes: Same dimensions (2×2), all entries match
Not equal:
C = [1 2] D = [1 2 0]
[3 4] [3 4 0]
Different dimensions: C is 2×2, D is 2×3
Adding Matrices
Add corresponding entries
Requirement: Matrices must have SAME dimensions
Formula: [A + B]ᵢⱼ = aᵢⱼ + bᵢⱼ
Example 1: Add Matrices
[1 2] + [5 1] = [1+5 2+1] = [6 3]
[3 4] [2 3] [3+2 4+3] [5 7]
Example 2: Larger Matrices
[1 2 -1] [4 0 2] [5 2 1]
[0 3 5] + [1 2 -3] = [1 5 2]
[-2 4 0] [0 1 1] [-2 5 1]
Example 3: Cannot Add
[1 2] + [1 2 3]
[3 4] [4 5 6]
Cannot add: Different dimensions (2×2 vs 2×3)
Subtracting Matrices
Subtract corresponding entries
Same requirement: Matrices must have same dimensions
Formula: [A - B]ᵢⱼ = aᵢⱼ - bᵢⱼ
Example 1: Subtract Matrices
[5 3] - [2 1] = [5-2 3-1] = [3 2]
[6 4] [3 0] [6-3 4-0] [3 4]
Example 2: With Negatives
[4 -1] [2 3] [2 -4]
[0 5] - [-1 2] = [1 3]
Scalar Multiplication
Multiply every entry by a scalar (number)
Formula: [kA]ᵢⱼ = k · aᵢⱼ
Example 1: Multiply by Scalar
3 · [2 1] = [6 3]
[4 0] [12 0]
Example 2: Negative Scalar
-2 · [1 -3] = [-2 6]
[5 0] [-10 0]
Example 3: Fraction Scalar
1/2 · [4 6] = [2 3]
[8 -2] [4 -1]
Combining Operations
Use order of operations
Example 1: Add Then Multiply
Find: 2A + B where
A = [1 2] B = [3 0]
[3 4] [1 2]
Calculate 2A:
2A = [2 4]
[6 8]
Add B:
2A + B = [2 4] + [3 0] = [5 4]
[6 8] [1 2] [7 10]
Example 2: Subtraction and Scalar
Find: 3A - 2B where
A = [4 1] B = [2 3]
[0 5] [1 0]
Calculate 3A:
3A = [12 3]
[0 15]
Calculate 2B:
2B = [4 6]
[2 0]
Subtract:
3A - 2B = [12 3] - [4 6] = [8 -3]
[0 15] [2 0] [-2 15]
Properties of Matrix Operations
Commutative (addition): A + B = B + A
Associative (addition): (A + B) + C = A + (B + C)
Distributive (scalar): k(A + B) = kA + kB
Additive identity: A + 0 = A (0 is zero matrix)
Example: Verify Commutative
A = [1 2] B = [3 0]
[4 5] [1 2]
A + B = [4 2]
[5 7]
B + A = [4 2]
[5 7]
A + B = B + A ✓
Real-World Applications
Computer graphics: Transformations (rotate, scale, translate)
Economics: Input-output models
Network analysis: Connections between nodes
Data science: Organizing datasets
Physics: System of equations, quantum mechanics
Example: Student Scores
Matrix of test scores:
Test1 Test2 Test3
Alice [85 90 88]
Bob [78 82 85]
Charlie [92 88 90]
Class averages as row matrix:
[85 86.7 87.7]
Practice
What are the dimensions of matrix [1 2 3; 4 5 6]?
Add: [1 2] + [3 0] = ?
Calculate: 3 · [2 1] = ?
Can you add a 2×3 matrix to a 3×2 matrix?