Unit 3: Matrices
Mathematics notes · PTU syllabus (UGCC2501)
On this page
Unit summary
A matrix is a rectangular arrangement of numbers in rows and columns. Matrices are used everywhere in computing: images are matrices of pixels, spreadsheets are matrices, and computer graphics and machine learning are built on matrix operations.
This unit covers the types of matrices and the basic operations: scalar multiplication, addition, subtraction, multiplication and transpose.
After this unit you can
- Identify the order and type of a matrix
- Add, subtract and scalar-multiply matrices
- Multiply two matrices and check when multiplication is possible
- Find the transpose and use its properties
PTU syllabus topics
- Introduction
- types of matrix (row, column, rectangular, square, diagonal, scalar, unit, null, comparable, equal)
- scalar multiplication
- negative of a matrix
- addition and difference of matrices
- multiplication of matrices
- transpose of a matrix
Addition
(A + B)ᵢⱼ = aᵢⱼ + bᵢⱼ
Only for matrices of the same order
Multiplication
(AB)ᵢⱼ = Σ aᵢₖ bₖⱼ
Columns of A must equal rows of B
Transpose
(Aᵀ)ᵢⱼ = aⱼᵢ
Rows become columns
Order rule
AB ≠ BA in general
Matrix multiplication is not commutative
Topic 1
Introduction to matrices
A matrix is a rectangular array of numbers arranged in rows (horizontal) and columns (vertical), enclosed in brackets. A matrix with m rows and n columns has order m × n. The element in row i and column j is written aᵢⱼ.
Example
A = [2 5 7; 1 0 3] has 2 rows and 3 columns, so its order is 2 × 3, and a₁₃ = 7.
Exam tip
The order is always written as rows × columns. A 2 × 3 matrix has 6 elements.
Topic 2
Types of matrices
| Type | Definition | Example |
|---|---|---|
| Row matrix | Only one row (1 × n) | [3 1 4] |
| Column matrix | Only one column (m × 1) | [2; 5; 9] |
| Rectangular matrix | Rows ≠ columns | 2 × 3 matrix |
| Square matrix | Rows = columns | 3 × 3 matrix |
| Diagonal matrix | Square; all non-diagonal elements are 0 | [4 0; 0 7] |
| Scalar matrix | Diagonal matrix with all diagonal elements equal | [5 0; 0 5] |
| Unit (identity) matrix | Scalar matrix with diagonal elements 1, written I | [1 0; 0 1] |
| Null (zero) matrix | Every element is 0, written O | [0 0; 0 0] |
- Comparable matrices have the same order.
- Equal matrices have the same order and equal corresponding elements.
Exam tip
Every unit matrix is a scalar matrix, and every scalar matrix is a diagonal matrix — but not the other way round.
Topic 3
Scalar multiplication, negative, addition and difference
- Scalar multiplication: multiply every element by the number k. If A = [1 2; 3 4], then 3A = [3 6; 9 12].
- Negative of a matrix: −A = (−1)A, so every element changes sign.
- Addition and subtraction: only for matrices of the same order; add or subtract corresponding elements.
Example
A = [2 3; 1 4], B = [5 1; 0 2]. A + B = [7 4; 1 6] and A − B = [−3 2; 1 2].
Properties of addition: A + B = B + A (commutative), (A + B) + C = A + (B + C) (associative), A + O = A, and A + (−A) = O.
Topic 4
Multiplication of matrices
The product AB is defined only when the number of columns of A equals the number of rows of B. If A is m × n and B is n × p, then AB is m × p.
- 1Check orders
Columns of A must equal rows of B
- 2Pick row i of A
- 3Pick column j of B
- 4Multiply pairwise and add
This gives element (i, j) of AB
- 5Repeat for every row and column
Example
A = [1 2; 3 4], B = [5 6; 7 8]. AB = [1·5 + 2·7 1·6 + 2·8; 3·5 + 4·7 3·6 + 4·8] = [19 22; 43 50].
- Matrix multiplication is not commutative: in general AB ≠ BA.
- It is associative: (AB)C = A(BC), and distributive: A(B + C) = AB + AC.
- AI = IA = A for the identity matrix I.
Exam tip
Always write "Since A is m × n and B is n × p, AB exists and is of order m × p" before multiplying. Examiners give marks for it.
Topic 5
Transpose of a matrix
The transpose of A, written Aᵀ or A', is obtained by changing rows into columns. If A is m × n, Aᵀ is n × m.
Example
A = [1 2 3; 4 5 6] (2 × 3). Aᵀ = [1 4; 2 5; 3 6] (3 × 2).
Properties:
- (Aᵀ)ᵀ = A
- (A + B)ᵀ = Aᵀ + Bᵀ
- (kA)ᵀ = kAᵀ
- (AB)ᵀ = BᵀAᵀ (note the reversed order)
- A square matrix is symmetric if Aᵀ = A and skew-symmetric if Aᵀ = −A.
Key terms
- Order
- The size of a matrix, rows × columns
- Square matrix
- A matrix with equal numbers of rows and columns
- Identity matrix
- A square matrix with 1s on the diagonal and 0s elsewhere
- Comparable matrices
- Matrices of the same order
- Transpose
- The matrix formed by interchanging rows and columns
- Symmetric matrix
- A square matrix equal to its own transpose
Quick revision
- Order is rows × columns.
- Add or subtract only matrices of the same order.
- AB exists only if columns of A = rows of B; then the order is m × p.
- AB ≠ BA in general.
- (AB)ᵀ = BᵀAᵀ.
Important exam questions
Practice questions written to the PTU exam pattern for this unit's syllabus: short answers (Section A style) and long answers (Sections B and C style).
Short-answer questions
- Q1.Define a matrix and its order.
- Q2.Differentiate between a scalar matrix and a unit matrix.
- Q3.When are two matrices said to be equal?
- Q4.State the condition for multiplying two matrices.
- Q5.If A = [1 2; 3 4], find 2A and Aᵀ.
- Q6.Define a symmetric matrix with an example.
Long-answer questions
- Q1.Explain the different types of matrices with examples.
- Q2.If A = [1 2; 3 4] and B = [2 0; 1 3], find AB and BA and show that AB ≠ BA.
- Q3.Verify that (AB)ᵀ = BᵀAᵀ for A = [1 2; 0 1] and B = [3 1; 2 4].
- Q4.If A = [2 3; 1 5] and B = [1 −1; 2 0], find A + B, A − B, 3A − 2B and Aᵀ.
Stuck on this unit?
Message SBS on WhatsApp for help with Mathematics, or to ask about studying BCA at Synetic.
