Matrices • Topic 1 of 3

Matrices: Order, Types & Equality

A matrix is a rectangular array of numbers (or functions) arranged in horizontal rows and vertical columns and enclosed in brackets. We name matrices with capital letters and write a general matrix as $A=[a_{ij}]$, where $a_{ij}$ is the entry sitting in the $i$-th row and $j$-th column. So in

$$A=\begin{bmatrix} 2 & 7 & -1\\ 0 & 3 & 5\end{bmatrix},$$

the entry $a_{12}=7$, $a_{23}=5$ and $a_{21}=0$. Read the subscripts as "row first, column second" — this convention is used everywhere and mixing it up is the most common slip.

Order of a matrix

A matrix with $m$ rows and $n$ columns is said to be of order $m\times n$ (read "$m$ by $n$"). The order alone tells you how many entries the matrix has: an $m\times n$ matrix has exactly $mn$ entries. A neat counting fact follows — the possible orders of a matrix with a fixed number of entries $N$ are precisely the factor pairs of $N$. For example $N=12$ gives the orders $1\times12,\ 2\times6,\ 3\times4,\ 4\times3,\ 6\times2,\ 12\times1$ (six in all); a prime number of entries, say $7$, gives only $1\times7$ and $7\times1$.

Constructing a matrix from a rule

Many problems hand you a formula such as $a_{ij}=\tfrac{(i+j)^2}{2}$ and ask you to build the matrix. The recipe never changes: substitute each $(i,j)$ pair for the required order and place the value in its slot. This is the matrix version of "evaluate a function at every point of a grid".

Types of matrices

TypeDefining conditionExample
Row matrixonly one row ($1\times n$)$\begin{bmatrix}2 & 5 & 7\end{bmatrix}$
Column matrixonly one column ($m\times 1$)$\begin{bmatrix}1\\ 4\\ 9\end{bmatrix}$
Square matrix$m=n$ (order $n$)$\begin{bmatrix}1 & 2\\ 3 & 4\end{bmatrix}$
Diagonal matrixsquare, $a_{ij}=0$ for $i\ne j$$\begin{bmatrix}5 & 0\\ 0 & 2\end{bmatrix}$
Scalar matrixdiagonal with all diagonal entries equal$\begin{bmatrix}3 & 0\\ 0 & 3\end{bmatrix}$
Identity $I_n$scalar matrix with each diagonal entry $1$$\begin{bmatrix}1 & 0\\ 0 & 1\end{bmatrix}$
Zero (null) $O$every entry $0$ (any order)$\begin{bmatrix}0 & 0\\ 0 & 0\end{bmatrix}$

The nesting is worth memorising: identity $\subset$ scalar $\subset$ diagonal $\subset$ square. Every identity matrix is scalar (its equal diagonal value is $1$); every scalar matrix is diagonal; every diagonal matrix is square. The main diagonal of a square matrix runs from the top-left $a_{11}$ to the bottom-right $a_{nn}$, and the diagonal entries are $a_{11},a_{22},\dots,a_{nn}$.

Equality of matrices

Two matrices $A=[a_{ij}]$ and $B=[b_{ij}]$ are equal, written $A=B$, only when both conditions hold: (i) they have the same order, and (ii) their corresponding entries are equal, i.e. $a_{ij}=b_{ij}$ for every $i$ and $j$.

$$A=B \iff a_{ij}=b_{ij}\ \text{ for all } i,j \ \ (\text{and } A,B \text{ have the same order}).$$

This single idea is the engine behind every "find $x,y,z$" question: a single matrix equation is unpacked into a system of ordinary scalar equations, one per entry, which you then solve. Note that $\begin{bmatrix}1 & 2\end{bmatrix}$ and $\begin{bmatrix}1\\ 2\end{bmatrix}$ are not equal — same numbers, different orders.

Deeper Insight — order is the gatekeeper. Almost every rule in this chapter begins with a question about order. Two matrices can be added only if their orders match; they can be multiplied only if the "inner" orders match; equality demands identical order before you even look at the entries. So train yourself to write down the order of every matrix first — it tells you instantly whether an operation is even legal, and it is the cheapest way to catch a mistake before it spreads.

A 3 by 3 matrix with rows and columns labelled, entry a-one-two highlighted, showing a-i-j sits in row i and column j A general 3×3 matrix A = [aₙₚ] a11 a12 a13 a21 a22 a23 a31 a32 a33 row 1 row 2 row 3 col 1 col 2 col 3 a₁₂ : row 1, col 2 aₙₚ = entry in row i, column j Mini grids of the special types of matrices: row, column, square, diagonal and identity Special types of matrices Row (1×3) Column (3×1) Square (2×2) 0 0 Diagonal 1 0 0 1 Identity I
1
Worked Example
If $\begin{bmatrix} x+y & 2\\ 5 & x-y\end{bmatrix}=\begin{bmatrix} 7 & 2\\ 5 & 3\end{bmatrix}$, find $x$ and $y$.
Solution

Equality entry-by-entry gives $x+y=7$ and $x-y=3$. Adding: $2x=10\Rightarrow x=5$; then $y=2$.

Answer: $x=5,\ y=2$.

2
Worked Example
Construct the $2\times2$ matrix $A=[a_{ij}]$ where $a_{ij}=\dfrac{(i+j)^2}{2}$.
Solution

$a_{11}=\tfrac{(2)^2}{2}=2,\ a_{12}=\tfrac{(3)^2}{2}=\tfrac92,\ a_{21}=\tfrac{9}{2},\ a_{22}=\tfrac{(4)^2}{2}=8$. So $A=\begin{bmatrix} 2 & \tfrac92\\[2pt] \tfrac92 & 8\end{bmatrix}$.

Answer: $A=\begin{bmatrix} 2 & \tfrac92\\[2pt] \tfrac92 & 8\end{bmatrix}$

3
Worked Example
How many matrices of order $2\times3$ can be formed with each entry $0$ or $1$?
Solution

There are $2\times3=6$ positions and each independently has $2$ choices, giving $2^{6}=64$ matrices.

Answer: $2^{6}=64$ matrices.

4
Worked Example
Write the orders possible for a matrix having exactly $7$ elements.
Solution

$7$ is prime, so the only factor pairs are $1\times7$ and $7\times1$ — just two possible orders.

Answer: Two orders: $1\times7$ and $7\times1$.

5
Worked Example
A matrix $A$ has $18$ elements. Write down all possible orders of $A$. If, instead, it had $5$ elements, what are the possible orders?
Solution

The orders are the factor pairs of the number of entries. For $18$: $1\times18,\ 2\times9,\ 3\times6,\ 6\times3,\ 9\times2,\ 18\times1$ — six orders. For $5$ (prime): only $1\times5$ and $5\times1$ — two orders.

Answer: For $18$: six orders ($1\times18,\ 2\times9,\ 3\times6,\ 6\times3,\ 9\times2,\ 18\times1$); for $5$: two orders ($1\times5$ and $5\times1$).

6
Worked Example
Construct the $3\times2$ matrix $A=[a_{ij}]$ whose entries are $a_{ij}=\dfrac{|\,i-3j\,|}{2}$.
Solution

Substitute each $(i,j)$ with $i=1,2,3$ and $j=1,2$:

Row 1: $a_{11}=\tfrac{|1-3|}{2}=1,\ a_{12}=\tfrac{|1-6|}{2}=\tfrac52$. Row 2: $a_{21}=\tfrac{|2-3|}{2}=\tfrac12,\ a_{22}=\tfrac{|2-6|}{2}=2$. Row 3: $a_{31}=\tfrac{|3-3|}{2}=0,\ a_{32}=\tfrac{|3-6|}{2}=\tfrac32$. Hence $A=\begin{bmatrix} 1 & \tfrac52\\[2pt] \tfrac12 & 2\\[2pt] 0 & \tfrac32\end{bmatrix}$.

Answer: $A=\begin{bmatrix} 1 & \tfrac52\\[2pt] \tfrac12 & 2\\[2pt] 0 & \tfrac32\end{bmatrix}$

7
Worked Example
Identify the type of each matrix: $P=\begin{bmatrix}4 & 0 & 0\\ 0 & 4 & 0\\ 0 & 0 & 4\end{bmatrix}$, $Q=\begin{bmatrix}0 & 0\\ 0 & 0\end{bmatrix}$, $R=\begin{bmatrix}1 & 0 & 0\\ 0 & 1 & 0\\ 0 & 0 & 1\end{bmatrix}$.
Solution

$P$ is diagonal with all diagonal entries equal ($=4$), so it is a scalar matrix. $Q$ has every entry $0$, so it is a zero (null) matrix. $R$ is a scalar matrix whose common diagonal value is $1$, so it is the identity matrix $I_3$.

Answer: $P$ is a scalar matrix, $Q$ is a zero (null) matrix, and $R$ is the identity matrix $I_3$.

8
Worked Example
Find $x,y,z$ and $w$ if $\begin{bmatrix} x+y & 2z+w\\ x-y & z-w\end{bmatrix}=\begin{bmatrix} 6 & 4\\ 2 & -1\end{bmatrix}$.
Solution

Equating entries: $x+y=6$, $x-y=2$, $2z+w=4$, $z-w=-1$. From the first pair, $2x=8\Rightarrow x=4,\ y=2$. Adding the last pair, $3z=3\Rightarrow z=1$, then $w=z+1=2$. Check $2z+w=2+2=4$. So $x=4,\ y=2,\ z=1,\ w=2$.

Answer: $x=4,\ y=2,\ z=1,\ w=2$.

9
Worked Example
For $A=\begin{bmatrix}a-b & 2a+c\\ 2a-b & 3c+d\end{bmatrix}=\begin{bmatrix}-1 & 5\\ 0 & 13\end{bmatrix}$, find $a,b,c,d$.
Solution

Entry-by-entry: $a-b=-1$, $2a-b=0$, $2a+c=5$, $3c+d=13$. Subtracting the first from the second: $a=1$; then $b=a+1=2$. From $2a+c=5$: $c=3$. From $3c+d=13$: $d=13-9=4$. So $a=1,\ b=2,\ c=3,\ d=4$.

Answer: $a=1,\ b=2,\ c=3,\ d=4$.

10
Worked Example
Write a general $3\times3$ diagonal matrix and state how many of its $9$ entries can be non-zero. How does a scalar matrix differ?
Solution

A $3\times3$ diagonal matrix has the form $\begin{bmatrix}d_1 & 0 & 0\\ 0 & d_2 & 0\\ 0 & 0 & d_3\end{bmatrix}$; only the $3$ diagonal entries $d_1,d_2,d_3$ may be non-zero, the other $6$ are forced to $0$. A scalar matrix is the special case $d_1=d_2=d_3=k$, i.e. $kI_3$; it has just one independent value.

Answer: A diagonal matrix has only its $3$ diagonal entries possibly non-zero; a scalar matrix is the special case $d_1=d_2=d_3=k$, i.e. $kI_3$.

11
Worked Example
The number of all possible $2\times2$ matrices with entries from the set $\{1,2,3\}$ is?
Solution

A $2\times2$ matrix has $4$ positions, and each can independently be filled in $3$ ways. By the multiplication principle the count is $3^{4}=81$ matrices.

Answer: $3^{4}=81$ matrices.

Key Points

  • A matrix $A=[a_{ij}]$ of order $m\times n$ has $m$ rows, $n$ columns and $mn$ entries; $a_{ij}$ sits in row $i$, column $j$.
  • The possible orders of a matrix with $N$ entries are exactly the factor pairs of $N$ (a prime $N$ gives only two orders).
  • Build a matrix from a rule $a_{ij}=f(i,j)$ by substituting every $(i,j)$ pair for the required order.
  • Type ladder for square matrices: identity $\subset$ scalar $\subset$ diagonal $\subset$ square; identity $I_n$ is the scalar matrix with diagonal $1$.
  • Row matrix is $1\times n$, column matrix is $m\times 1$, zero matrix $O$ has every entry $0$.
  • $A=B$ needs the same order AND $a_{ij}=b_{ij}$ for all $i,j$; one matrix equation unpacks into many scalar equations.
  • Always note a matrix's order first — it decides whether addition, multiplication or equality is even allowed.
Tap an option to check your answer0 / 4
Q1.A matrix has $18$ elements. How many distinct orders are possible?
Explanation: Factor pairs of $18$: $1\times18,2\times9,3\times6,6\times3,9\times2,18\times1$ — six orders.
Q2.A scalar matrix is always a:
Explanation: A scalar matrix is diagonal with equal diagonal entries, so it is a special diagonal matrix.
Q3.If $\begin{bmatrix}a & 3\\ 0 & b\end{bmatrix}=\begin{bmatrix}2 & 3\\ 0 & 5\end{bmatrix}$, then $a+b=$
Explanation: $a=2,\ b=5\Rightarrow a+b=7$.
Q4.The number of $2\times2$ matrices with entries from $\{0,1\}$ is:
Explanation: $4$ positions, $2$ choices each: $2^4=16$.