Theory
You use matrices every day
Your phone screen is a grid of pixels, something like 1080 columns × 2400 rows. Your class marksheet is a grid: one row per student, one column per subject. Your Instagram feed layout, a chessboard, an Excel sheet, all grids.
Mathematics calls a grid of numbers a matrix. This topic teaches you the one thing everything else builds on: how to describe a matrix's size.
Theory
A matrix is a spreadsheet
Picture a small Excel sheet. Rows run across, columns stand up and down, and every cell holds one number. Ask "how big is this sheet?" and you would naturally answer "3 rows and 4 columns". Congratulations, you just stated the order of a matrix.
Theory
Order m×n, rows first
A matrix with m rows and n columns has order m×n, read "m by n". Rows always come first.
A = ⎡ 1 2 3 ⎤
⎣ 4 5 6 ⎦
A has 2 rows and 3 columns, so its order is 2×3. And since every row holds n entries, an m×n matrix has m·n elements, here 2·3 = 6.
Quiz
Matrix B has rows (7 8), (9 10), (11 12). What is its order?
- 2×3
- 3×2
- 6×1
- 3×3
Show the answer
3×2
Count rows first: there are 3 rows, each with 2 entries, so B is 3×2. If you picked 2×3 you swapped rows and columns, the single most common matrix mistake. Rows first, always.
Theory
Finding one element: aᵢⱼ
Each entry has an address: aᵢⱼ means the entry in row i, column j. Exactly like a cinema ticket: row first, then seat.
For the matrix A above:
- a₁₂ = 2 (row 1, column 2)
- a₂₁ = 4 (row 2, column 1)
Notice a₁₂ and a₂₁ are different entries. The order of the two little numbers matters.
Think first
Same matrix A, rows (1 2 3) and (4 5 6).
Without looking back at the grid, what is a₂₃?
Show the answer
Row 2 is (4 5 6). Its 3rd entry is 6, so a₂₃ = 6.
If you said 3, you read row 1 by mistake. The first index picks the row, the second picks the column, cinema ticket order.
Quiz
A matrix has 12 elements. Which of these orders is NOT possible for it?
- 3×4
- 2×6
- 12×1
- 5×2
Show the answer
5×2
The element count is rows × columns. 3·4, 2·6 and 12·1 all give 12, but 5·2 = 10. Exams love this: "a matrix has 12 elements, list all possible orders" just means list the factor pairs of 12.
Watch out
The mark-losing mistake
2×3 and 3×2 are different matrices with different shapes. Writing the order backwards costs easy marks, and later it breaks everything: matrix addition and multiplication have rules built entirely on order. Drill it now: Rows before Columns, like RC car.
Theory
Where you will meet this again
Every image filter multiplies pixel matrices. Graphs in data structures are stored as adjacency matrices. Machine learning is mostly giant matrix multiplication. And your very next topics, matrix operations, inverse and Cramer's rule, all start by checking the order before doing anything.
Summary
Key takeaways
- A matrix is a rectangular grid of numbers arranged in rows and columns.
- Order is m×n: m rows, n columns, rows always first.
- An m×n matrix has m·n elements; possible orders for k elements are the factor pairs of k.
- aᵢⱼ is the entry at row i, column j, like a cinema ticket: row, then seat.
- Memory hook: RC car, Rows then Columns.