WEEK 5: MATRIX ALGEBRA
1. Definition of a Matrix
A matrix is a rectangular array of numbers arranged in rows and columns, enclosed in brackets.
A matrix with m rows and n columns is called an m × n matrix (read as “m by n”).
𝑎11 𝑎12 ⋯ 𝑎1𝑛
𝑎21 𝑎22 ⋯ 𝑎2𝑛
𝐴=[⋮ ⋮ ⋱ ⋮ ]
𝑎𝑚1 𝑎𝑚2 ⋯ 𝑎𝑚𝑛
Here, 𝑎𝑖𝑗 denotes the element in the ith row and jth column.
2. Types of Matrices
(a) Row Matrix
A matrix with one row.
[2 −1 4]
(b) Column Matrix
A matrix with one column.
3
[5]
−2
(c) Square Matrix
A matrix with equal number of rows and columns.
1 2
[ ]
3 4
(d) Zero (Null) Matrix
All elements are zero.
0 0
[ ]
0 0
(e) Identity Matrix
A square matrix with 1s on the main diagonal and 0s elsewhere, denoted by 𝐼.
1 0
𝐼2 = [ ]
0 1
(f) Diagonal Matrix
Non-zero elements appear only on the main diagonal.
2 0 0
[0 −1 0]
0 0 5
3. Matrix Operations
3.1 Addition and Subtraction
Matrices can be added or subtracted only if they have the same order.
Example:
1 2 5 −1
𝐴=[ ],𝐵 = [ ]
3 4 0 2
1 + 5 2 + (−1) 6 1
𝐴+𝐵 =[ ]=[ ]
3+0 4+2 3 6
Properties:
• Commutative: 𝐴 + 𝐵 = 𝐵 + 𝐴
• Associative: 𝐴 + (𝐵 + 𝐶) = (𝐴 + 𝐵) + 𝐶
• Additive identity: 𝐴 + 0 = 𝐴
• Additive inverse: 𝐴 + (−𝐴) = 0
3.2 Scalar Multiplication
Each element of the matrix is multiplied by a scalar.
2 −1 6 −3
3[ ]=[ ]
4 0 12 0
3.3 Matrix Multiplication
If 𝐴is an 𝑚 × 𝑛matrix and 𝐵is an 𝑛 × 𝑝matrix, then:
𝐴𝐵 exists and is an 𝑚 × 𝑝 matrix
Example:
1 2 2 1
𝐴=[ ],𝐵 = [ ]
3 4 0 5
(1)(2) + (2)(0) (1)(1) + (2)(5) 2 11
𝐴𝐵 = [ ]=[ ]
(3)(2) + (4)(0) (3)(1) + (4)(5) 6 23
Note: Matrix multiplication is not commutative, i.e. 𝐴𝐵 ≠ 𝐵𝐴in general.
Key properties:
• Associative: 𝐴(𝐵𝐶) = (𝐴𝐵)𝐶
• Distributive: 𝐴(𝐵 + 𝐶) = 𝐴𝐵 + 𝐴𝐶
• Not commutative: 𝐴𝐵 ≠ 𝐵𝐴in general
4. Transpose of a Matrix
The transpose of a matrix 𝐴, denoted 𝐴𝑇 , is obtained by interchanging rows and columns.
1 4
1 2 3 𝑇
𝐴=[ ] ⇒ 𝐴 = [2 5 ]
4 5 6
3 6
Properties:
• (𝐴⊤ )⊤ = 𝐴
• (𝐴 + 𝐵)⊤ = 𝐴⊤ + 𝐵 ⊤
• (𝑘𝐴)⊤ = 𝑘𝐴⊤
• Important: (𝐴𝐵)⊤ = 𝐵 ⊤ 𝐴⊤
5. Determinants
5.1 Determinant of a 2 × 2Matrix
𝑎 𝑏
𝐴=[ ]
𝑐 𝑑
∣ 𝐴 ∣= 𝑎𝑑 − 𝑏𝑐
Example:
3 1
[ ] ⇒∣ 𝐴 ∣= (3)(2) − (1)(5) = 6 − 5 = 1
5 2
5.2 Determinant of a 3 × 3Matrix
Example:
1 2 3
[0 1 4 ]
5 6 0
∣ 𝐴 ∣= 1(1 ⋅ 0 − 4 ⋅ 6) − 2(0 ⋅ 0 − 4 ⋅ 5) + 3(0 ⋅ 6 − 1 ⋅ 5)
= −24 + 40 − 15 = 1
The Laplace Expansion Theorem
6. Elementary Row Operations
Elementary Row Operations (EROs)
Used for solving systems and finding rank.
Three operations:
1. Swap two rows: 𝑅𝑖 ↔ 𝑅𝑗
2. Multiply a row by a non-zero scalar: 𝑅𝑖 → 𝑘𝑅𝑖
3. Add a multiple of one row to another: 𝑅𝑖 → 𝑅𝑖 + 𝑘𝑅𝑗
These operations:
• Do not change the solution set of linear equations
• Allow conversion to echelon or reduced echelon form
What is Echelon Form?
A matrix is in Row Echelon Form (REF) if it satisfies three rules:
Rule 1: All non-zero rows are above any rows of all zeros
Example:
1 2 3
[0 4 1]
0 0 0
The zero row is at the bottom
Rule 2: Each leading entry (pivot) of a row is to the right of the leading entry of the row
above
A leading entry/pivot is the first non-zero number from the left in a row.
Example of REF:
1 2 3 1
[0 4 1 7]
0 0 6 2
The pivots appear like a staircase moving right → ✓
This staircase pattern is essential.
Rule 3: All entries below each pivot are zero
For pivot in row 𝑖, column 𝑗, all rows 𝑖 + 1below must have 0 in that column.
Example:
1 5 2
[0 3 8]
0 0 4
Each pivot has zeros beneath it → ✓
Example: Convert to Echelon Form
Reduce the matrix:
2 4 −2
𝐴 = [4 8 −4]
6 9 −3
Step 1: Make pivot in row 1, column 1
1 1 2 −1
𝑅1 → 𝑅1 ⇒ [4 8 −4]
2
6 9 −3
Step 2: Eliminate entries below pivot
𝑅2 → 𝑅2 − 4𝑅1
𝑅3 → 𝑅3 − 6𝑅1
Compute:
1 2 −1
[0 0 0]
0 −3 3
Step 3: Pivot in second non-zero row
Swap rows 2 and 3:
1 2 −1
[0 −3 3 ]
0 0 0
This is now Row Echelon Form.
7. Inverse of a Matrix
A matrix has an inverse only if its determinant is not zero.
7.1 Inverse of a 𝟐 × 𝟐Matrix
𝒂 𝒃
𝑨=[ ]
𝒄 𝒅
𝟏 𝒅 −𝒃
𝑨−𝟏 = [ ]
𝒂𝒅 − 𝒃𝒄 −𝒄 𝒂
Example:
𝟐 𝟏
𝑨=[ ]
𝟓 𝟑
∣ 𝑨 ∣= (𝟐)(𝟑) − (𝟏)(𝟓) = 𝟏
𝟑 −𝟏
𝑨−𝟏 = [ ]
−𝟓 𝟐
6.1 Inverse of a 𝟑 × 𝟑 Matrix
Inverse via Augmented Matrix Method
To compute 𝐴−1:
1. Form the augmented matrix [ 𝐴 ∣ 𝐼 ].
2. Perform row operations until it becomes [ 𝐼 ∣ 𝐴−1 ].
Example
7. Solving Simultaneous Linear Equations Using Matrices
7.1 Inverse Method
Consider the system:
𝟐𝒙 + 𝒚 =𝟓
𝟑𝒙 + 𝟐𝒚 =𝟖
Write in matrix form:
𝑨𝑿 = 𝑩
𝟐 𝟏 𝒙 𝟓
[ ] [𝒚] = [ ]
𝟑 𝟐 𝟖
−𝟏
𝑿=𝑨 𝑩
𝟐 −𝟏
𝑨−𝟏 = [ ]
−𝟑 𝟐
𝒙 𝟐 −𝟏 𝟓 𝟐
[ 𝒚] = [ ][ ] = [ ]
−𝟑 𝟐 𝟖 𝟏
𝒙 = 𝟐, 𝒚 = 𝟏
7.2 Row Reduction (Gaussian Elimination)
Gaussian elimination solves systems by transforming the augmented matrix into echelon form
using row operations.
Steps
1. Identify pivot position.
2. Use the pivot to eliminate all entries below it.
3. Move to the next row and repeat.
Back-substitute to find solutions.
Example
SHARE ENG MATHS NOTES LECTURE 1 AND 2
Example
a) A store sells 2 types of products, A and B. The number of units sold per week depends on the
advertising budget (in thousands) as:
2 1 𝑥 10
[ ][ ] = [ ]
1 3 𝑦 15
Solve for 𝑥 and 𝑦 using matrix inverse method. (10 Marks)
SOLUTION
Matrix Algebra – Inverse Method (10 marks)
Given:
2 1 𝑥 10
[ ] [𝑦] = [ ]
1 3 15
Let:
2 1 𝑥 10
𝐴=[ ] , 𝑋 = [𝑦 ] , 𝐵 = [ ]
1 3 15
So:
𝐴𝑋 = 𝐵 ⇒ 𝑋 = 𝐴−1 𝐵
Find the determinant of 𝑨
∣ 𝐴 ∣= (2)(3) − (1)(1) = 6 − 1 = 5 ≠ 0
Since the determinant is non-zero, the inverse exists.
Find the inverse of 𝑨
For a 2 × 2matrix:
1 𝑑 −𝑏
𝐴−1 = [ ]
∣ 𝐴 ∣ −𝑐 𝑎
1 3 −1
𝐴−1 = [ ]
5 −1 2
Step 3: Compute 𝑿 = 𝑨−𝟏 𝑩
1 3 −1 10
𝑋= [ ][ ]
5 −1 2 15
1 (3 × 10) + (−1 × 15)
𝑋= [ ]
5 (−1 × 10) + (2 × 15)
1 30 − 15 1 15
𝑋= [ ]= [ ]
5 −10 + 30 5 20
3
𝑋=[ ]
4
𝑥 = 3, 𝑦 = 4