Worked examples — Matrix definition — rows, columns, order, elements
This page is a drill hall. The parent note taught you the four ideas — rows, columns, order, elements. Here we hit every kind of question those ideas can produce, one worked example per scenario, so you never meet a matrix problem you have not already seen.
Before we start, one promise about notation. Everything we use is built here:
- A matrix is a grid of numbers inside brackets.
- The order means " rows tall, columns wide" — read rows first.
- means "the number sitting in row , column " — again row first, column second ("RC").
- and always start at 1, never at 0.
If any of those feel shaky, the parent note builds them from the ground up. From here on we use them at speed.
The scenario matrix
Every matrix-reading or matrix-building question you can be asked falls into one of these cells. The worked examples below are labelled with the cell they cover, so together they fill the whole table.
| Cell | Scenario | Covered by |
|---|---|---|
| A | Read an element from a small square grid | Example 1 |
| B | Rectangular (non-square) grid — order not commutative | Example 2 |
| C | Degenerate shapes: a single number, a row vector, a column vector | Example 3 |
| D | The empty / edge index — asking for an element that does not exist | Example 4 |
| E | Build a matrix from a formula with signs & a twist | Example 5 |
| F | Sign-sensitive build: alternating pattern (every sign case) | Example 6 |
| G | Real-world word problem — turn a table of data into a matrix and read it | Example 7 |
| H | Exam twist — two matrices equal, solve for unknowns (links to equality) | Example 8 |
Related ideas we brush against: Matrix Equality, Types of Matrices, Transpose of Matrix.

Look at the figure above: the same grid with the red arrow going down first (that picks the row ) and the blue arrow going across (that picks the column ). That single picture is the whole grammar of . Keep it in your mind's eye for every example.
[!example] Example 1 — Cell A: read a square grid
Find the order, then , and the diagonal element .
Step 1 — Count rows, then columns. 3 horizontal lines, 3 vertical lines → order . Why this step? Shape comes before contents; you cannot ask for row 4 in a 3-row matrix.
Step 2 — : go down to row 1, across to column 3. Row 1 is ; the 3rd entry is . So . Why this step? Red arrow (down) picks the row, blue arrow (across) picks the column — exactly the figure.
Step 3 — : go down to row 3, across to column 1. Row 3 is ; the 1st entry is . So . Why this step? Swapping the subscripts moves you to a completely different cell — , so .
Step 4 — : row 2, column 2. Row 2 is ; 2nd entry is . So .
[!example] Example 2 — Cell B: rectangle, order is not commutative
Find the order, the total number of elements, , , and state whether is square.
Step 1 — Order. 2 rows, 4 columns → order . Why this step? and are different shapes; unlike ordinary multiplication where , matrix order does not commute.
Step 2 — Total elements . Why this step? Each of the 2 rows holds 4 numbers, and counts them without overlap.
Step 3 — : row 1, column 4. Row 1 is ; 4th entry is . So .
Step 4 — : row 2, column 3. Row 2 is ; 3rd entry is . So .
Step 5 — Square? Square needs rows columns. Here , so not square (it is rectangular).
[!example] Example 3 — Cell C: the degenerate shapes
The smallest matrices strip the idea down to its bones. Three degenerate cases:
(a) A single number as a matrix . Order . Only element . This is a square matrix (rows columns ).
(b) A row vector . Order : one row, four columns. Here the first index is stuck at 1, only the second moves: .
(c) A column vector . Order : three rows, one column. Now the second index is stuck at 1: .
Why care about these? They are the limiting cases of the whole topic: a row vector is "a matrix that ran out of rows", a column vector "ran out of columns", and a is "both at once". Every general rule must still work here, and it does — the frozen index just never changes.
[!example] Example 4 — Cell D: the element that does not exist
Using from Example 2 (order ), a question asks for and for . Find them.
Step 1 — Test : row 3. Order is , so valid rows are . Row is out of range. Why this step? The index can never exceed ; asking for row 3 in a 2-row matrix has no answer — the element is undefined, not zero.
Step 2 — Test : column 5. Valid columns are . Column exceeds . Why this step? The second index can never exceed . is undefined.
Step 3 — State the allowed ranges. For any matrix of order : and . Anything outside is a non-existent element.
[!example] Example 5 — Cell E: build from a formula with a twist
Construct the matrix with (The term means "the bigger of and "; the smaller. Their difference is just how far apart the two indices are.)
Step 1 — Diagonal, . . So . Why this step? When the row and column indices agree, the gap is zero — a whole diagonal of s for free.
Step 2 — Off-diagonal. The value is , the distance between the two indices:
- , ,
- , ,
Why this step? of two numbers is exactly their absolute difference, which cannot be negative — so this build has no sign traps.
Step 3 — Assemble.
[!example] Example 6 — Cell F: every sign, alternating pattern
Construct the matrix with Here is a sign switch: it equals when is even and when is odd. We must handle both sign cases correctly.
Step 1 — Read the sign rule. even factor ; odd factor . Why this step? Getting the parity right in each cell is the whole difficulty; the magnitude is easy.
Step 2 — Row 1 ():
- : even →
- : odd →
- : even →
Step 3 — Row 2 ():
- : odd →
- : even →
- : odd →
Step 4 — Row 3 ():
- : even →
- : odd →
- : even →
Step 5 — Assemble.
[!example] Example 7 — Cell G: a real-world word problem
A snack stall records sales over 3 days for 2 items (samosas, chai):
- Monday: 40 samosas, 55 chai
- Tuesday: 30 samosas, 48 chai
- Wednesday: 52 samosas, 60 chai
Write this as a matrix with rows = days and columns = items. Then read and , and say what each means.
Step 1 — Fix the layout. Rows = days (3 of them), columns = items (2 of them) → order . Why this step? Choosing what rows and columns mean is the modelling step; every element then has a definite real-world reading.
Step 2 — Fill the grid (samosas in column 1, chai in column 2):
Step 3 — Read : row 3 (Wednesday), column 1 (samosas) . Meaning: 52 samosas sold on Wednesday.
Step 4 — Read : row 1 (Monday), column 2 (chai) . Meaning: 55 chai sold on Monday.
[!example] Example 8 — Cell H: exam twist, solve for unknowns
Two matrices are given as equal (they are equal matrices, meaning same order and every matching entry equal): Find and .
Step 1 — Match entry by entry. Equal matrices force each corresponding element equal:
- top-left:
- top-right: (automatically true — no info)
- bottom-left: (automatically true)
- bottom-right:
Why this step? Matrix equality is entry-wise; the two useful cells give a pair of ordinary equations.
Step 2 — Solve the system. Add the two equations: Why this step? Adding cancels , isolating immediately.
Step 3 — Back-substitute. From : .
[!mnemonic] Carry these away
- RC: Row before Column, always. Down first, then across (see the two arrows in the figure).
- Order never commutes: as a shape, even though the count is the same.
- Indices live in a box: , . Outside the box → the element does not exist.
- Build formulas: write the blank grid first, then feed each in — and watch parity for any .