IMOClass 12 › Matrices

Matrices

Types and Basic Operations

A matrix is a rectangular array of numbers arranged in rows and columns. A matrix with $m$ rows and $n$ columns is said to have order $m\times n$, and the entry in row $i$, column $j$ is written $a_{ij}$. Matrices give us a compact language for systems of equations, transformations and data tables.

Special types

TypeDefining condition
Row matrixonly one row ($1\times n$)
Column matrixonly one column ($m\times 1$)
Square matrix$m=n$
Diagonal matrixsquare, all off-diagonal entries $0$
Scalar matrixdiagonal with all diagonal entries equal
Identity $I_n$scalar matrix with diagonal entries $1$
Zero matrix $O$every entry $0$

Equality of matrices

Two matrices are equal only if they have the same order and every corresponding entry is equal: $A=B \iff a_{ij}=b_{ij}$ for all $i,j$. This single idea turns one matrix equation into a set of scalar equations — the standard way "find $x,y$" problems are solved.

How many entries?

An $m\times n$ matrix has $mn$ entries. If you must build a matrix with exactly $12$ entries, the possible orders are the factor pairs of $12$: $1\times12,\ 2\times6,\ 3\times4,\ 4\times3,\ 6\times2,\ 12\times1$ — six in all.

Example 1: If $\begin{bmatrix} x+y & 2\\ 5 & x-y\end{bmatrix}=\begin{bmatrix} 7 & 2\\ 5 & 3\end{bmatrix}$, find $x$ and $y$.

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

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

$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}$.

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

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

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

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

Quick recap
  • Order $m\times n$ means $m$ rows, $n$ columns; entry $a_{ij}$ sits in row $i$, column $j$.
  • Diagonal $\subset$ scalar $\subset$ identity is the nesting for square matrices with the obvious extra conditions.
  • $A=B$ requires equal order and equal corresponding entries.
  • An $m\times n$ matrix has $mn$ entries; possible orders for $N$ entries = factor pairs of $N$.
✓ Quick check
If A = [[0, 0], [0, 0]] and B is any 2×2 matrix, then AB equals:
Multiplication by a zero matrix always yields a zero matrix. So AB = 0.
If A = [[1, 2], [3, 4]] and B = [[2, 4], [6, 8]], then 2A − B is:
2A = [[2, 4], [6, 8]]. Subtracting B gives 2A − B = [[2−2, 4−4], [6−6, 8−8]] = [[0, 0], [0, 0]], which is a zero matrix.

Multiplication and Transpose

Matrices can be added, scaled and multiplied, but each operation has rules about when it is defined.

Addition and scalar multiplication

Two matrices can be added only if they have the same order; you add corresponding entries. Multiplying by a scalar $k$ multiplies every entry by $k$. These behave just like ordinary algebra: addition is commutative and associative, and $k(A+B)=kA+kB$.

Matrix multiplication

The product $AB$ is defined only when the number of columns of $A$ equals the number of rows of $B$. If $A$ is $m\times n$ and $B$ is $n\times p$, then $AB$ is $m\times p$, with

$$(AB)_{ij}=\sum_{k=1}^{n} a_{ik}\,b_{kj}\quad(\text{row }i \text{ of }A \text{ times column }j \text{ of }B).$$

What is — and is not — true

  • Not commutative: usually $AB\ne BA$; one product may exist while the other does not.
  • Associative & distributive: $A(BC)=(AB)C$ and $A(B+C)=AB+AC$.
  • Zero divisors exist: $AB=O$ does not imply $A=O$ or $B=O$.
  • $AI=IA=A$ for a conformable identity matrix.
Example 1: If $A=\begin{bmatrix}1&2\\3&4\end{bmatrix}$ and $B=\begin{bmatrix}2&0\\1&3\end{bmatrix}$, find $AB$.

$AB=\begin{bmatrix}1\cdot2+2\cdot1 & 1\cdot0+2\cdot3\\ 3\cdot2+4\cdot1 & 3\cdot0+4\cdot3\end{bmatrix}=\begin{bmatrix}4 & 6\\ 10 & 12\end{bmatrix}.$

Example 2: For the same $A,B$, show $AB\ne BA$.

$BA=\begin{bmatrix}2\cdot1+0\cdot3 & 2\cdot2+0\cdot4\\ 1\cdot1+3\cdot3 & 1\cdot2+3\cdot4\end{bmatrix}=\begin{bmatrix}2 & 4\\ 10 & 14\end{bmatrix}.$ Since $AB=\begin{bmatrix}4&6\\10&12\end{bmatrix}\ne BA$, multiplication is not commutative.

Example 3: If $A=\begin{bmatrix}1&2\\2&4\end{bmatrix}$ and $B=\begin{bmatrix}2&-4\\-1&2\end{bmatrix}$, compute $AB$.

$AB=\begin{bmatrix}1\cdot2+2\cdot(-1) & 1\cdot(-4)+2\cdot2\\ 2\cdot2+4\cdot(-1) & 2\cdot(-4)+4\cdot2\end{bmatrix}=\begin{bmatrix}0&0\\0&0\end{bmatrix}.$ A striking fact: $AB=O$ although neither $A$ nor $B$ is the zero matrix.

Example 4: Find $2A-3B$ for $A=\begin{bmatrix}1&-1\\0&2\end{bmatrix}$, $B=\begin{bmatrix}0&1\\1&1\end{bmatrix}$.

$2A=\begin{bmatrix}2&-2\\0&4\end{bmatrix}$, $3B=\begin{bmatrix}0&3\\3&3\end{bmatrix}$, so $2A-3B=\begin{bmatrix}2&-5\\-3&1\end{bmatrix}.$

Quick recap
  • Add/subtract only same-order matrices, entrywise; scalar $k$ multiplies every entry.
  • $AB$ exists iff (cols of $A$) $=$ (rows of $B$); result is (rows of $A$)$\times$(cols of $B$).
  • $(AB)_{ij}=\sum_k a_{ik}b_{kj}$ — row times column.
  • Multiplication is associative and distributive but not commutative.
  • $AB=O$ does not force $A=O$ or $B=O$ (zero divisors).
✓ Quick check
If trace of a 3×3 matrix A is defined as the sum of its diagonal entries and A = [[1, 2, 3], [4, 5, 6], [7, 8, 9]], then trace(A) equals:
Trace(A) = sum of diagonal elements a₁₁ + a₂₂ + a₃₃ = 1 + 5 + 9 = 15.
If A = [[1, 0, 0], [0, 2, 0], [0, 0, 3]], then trace(A) is:
Trace(A) = 1 + 2 + 3 = 6.

Symmetric, Skew and Invertible

The transpose $A^{T}$ (also written $A'$) of a matrix is obtained by interchanging its rows and columns: $(A^{T})_{ij}=a_{ji}$. If $A$ is $m\times n$, then $A^{T}$ is $n\times m$.

Rules of transpose

  • $(A^{T})^{T}=A$
  • $(A+B)^{T}=A^{T}+B^{T}$
  • $(kA)^{T}=kA^{T}$
  • Reversal law: $(AB)^{T}=B^{T}A^{T}$

Symmetric and skew-symmetric

A square matrix is symmetric if $A^{T}=A$ (so $a_{ij}=a_{ji}$), and skew-symmetric if $A^{T}=-A$ (so $a_{ij}=-a_{ji}$, forcing every diagonal entry to be $0$). A key theorem: every square matrix splits uniquely as

$$A=\underbrace{\tfrac12\left(A+A^{T}\right)}_{\text{symmetric}}+\underbrace{\tfrac12\left(A-A^{T}\right)}_{\text{skew-symmetric}}.$$

Invertible matrices

A square matrix $A$ is invertible if there exists $B$ with $AB=BA=I$; then $B=A^{-1}$ is unique. Such an inverse exists precisely when $\det A\ne 0$ (proved in the Determinants chapter). The reversal law also holds: $(AB)^{-1}=B^{-1}A^{-1}$.

Example 1: Find $A^{T}$ for $A=\begin{bmatrix}1&2&3\\4&5&6\end{bmatrix}$.

Swap rows and columns: $A^{T}=\begin{bmatrix}1&4\\2&5\\3&6\end{bmatrix}$ (a $3\times2$ matrix).

Example 2: Show $A=\begin{bmatrix}0&2\\-2&0\end{bmatrix}$ is skew-symmetric.

$A^{T}=\begin{bmatrix}0&-2\\2&0\end{bmatrix}=-A$. The diagonal entries are $0$ as required, so $A$ is skew-symmetric.

Example 3: Express $A=\begin{bmatrix}2&3\\1&4\end{bmatrix}$ as the sum of a symmetric and a skew-symmetric matrix.

$A^{T}=\begin{bmatrix}2&1\\3&4\end{bmatrix}$. Symmetric part $\tfrac12(A+A^{T})=\begin{bmatrix}2&2\\2&4\end{bmatrix}$; skew part $\tfrac12(A-A^{T})=\begin{bmatrix}0&1\\-1&0\end{bmatrix}$. Their sum is $A$.

Example 4: If $A=\begin{bmatrix}2&0\\0&3\end{bmatrix}$, find $A^{-1}$.

For a diagonal matrix invert each diagonal entry: $A^{-1}=\begin{bmatrix}\tfrac12&0\\0&\tfrac13\end{bmatrix}$. Check: $AA^{-1}=I$.

Quick recap
  • $A^{T}$ swaps rows and columns; $(A^{T})^{T}=A$ and $(AB)^{T}=B^{T}A^{T}$.
  • Symmetric: $A^{T}=A$. Skew-symmetric: $A^{T}=-A$ (diagonal entries all $0$).
  • Every square matrix $=$ symmetric part $\tfrac12(A+A^{T})$ $+$ skew part $\tfrac12(A-A^{T})$.
  • $A$ is invertible $\iff \det A\ne0$; the inverse is unique and $(AB)^{-1}=B^{-1}A^{-1}$.
✓ Quick check
A garment factory produces shirts and trousers in two colors: Red and Blue. To represent this data in a matrix where rows denote clothing types and columns denote colors, the order of the matrix will be:
There are 2 clothing types (rows) and 2 colors (columns), so the data forms a 2 × 2 matrix.
Ramesh goes to a Kirana store and buys 3 kg of sugar and 2 kg of rice. If the cost vector is represented as a column matrix C = [[40], [60]] and quantity as a row matrix Q = [3, 2], the total cost in ₹ is:
Total cost = QC = [3, 2] × [[40], [60]] = [3×40 + 2×60] = [120 + 120] = [240]. Thus, he pays ₹240.
Ready to test this chapter?
Take the Chapter Test →