Matrices

Matrices

IB MYP Maths Extended: Revision notes

Studying this course? Keep your progress in one place.

Key facts

  • A matrix is a rectangle of entries; its order is rows ×\times columns.
  • Add or subtract only matrices of the same order, entry by entry.
  • AB\mathbf{AB} exists only if columns of A\mathbf A = rows of B\mathbf B; use row times column. AB≠BA\mathbf{AB}\ne\mathbf{BA} usually.
  • An adjacency matrix records direct routes in a network; Mn\mathbf M^n counts nn-route journeys.

Matrices and order

A matrix is a rectangular array of entries; its order is rows first, then columns.

A matrix is a rectangular array of numbers called entries, written in brackets.

Its order is m×nm\times n: mm rows, then nn columns. A matrix with the same number of rows and columns is square.

Two matrices are equal only if they have the same order and equal entries.

  • Orderrows × columns

Worked example

State the order of (123401)\begin{pmatrix}1&2&3\\ 4&0&1\end{pmatrix} and of (2512)\begin{pmatrix}2\\ 5\\ 12\end{pmatrix}.

What is the order of (123456)\begin{pmatrix}1&2\\ 3&4\\ 5&6\end{pmatrix}?

Adding and scaling matrices

Combine matching entries of matrices of the same order; a scalar multiplies every entry.

You can only add or subtract matrices of the same order. Do it entry by entry.

To multiply by a number (a scalar), multiply every entry. Adding is commutative: A+B=B+A\mathbf A+\mathbf B=\mathbf B+\mathbf A.

  • Add or subtractsame order, entry by entry
  • Scalarmultiply every entry

Worked example

With A=(2−103)\mathbf A=\begin{pmatrix}2&-1\\ 0&3\end{pmatrix} and B=(14−25)\mathbf B=\begin{pmatrix}1&4\\ -2&5\end{pmatrix}, find 2A−B2\mathbf A-\mathbf B.

Find A+B\mathbf A+\mathbf B for the matrices above.

Multiplying matrices

Each entry of the product is a row of the first matrix times a column of the second.

The product AB\mathbf{AB} exists only if the number of columns of A\mathbf A equals the number of rows of B\mathbf B. If A\mathbf A is m×nm\times n and B\mathbf B is n×pn\times p, then AB\mathbf{AB} is m×pm\times p.

Multiply matching entries and add. Matrix multiplication is not commutative: for the matrices above AB=(43−615)\mathbf{AB}=\begin{pmatrix}4&3\\ -6&15\end{pmatrix} but BA=(211−417)\mathbf{BA}=\begin{pmatrix}2&11\\ -4&17\end{pmatrix}.

  • Order of AB(m×n)(n×p)→m×p(m\times n)(n\times p)\to m\times p

Worked example

M=(123401)\mathbf M=\begin{pmatrix}1&2&3\\ 4&0&1\end{pmatrix} is 2×32\times3 and N=(21031−1)\mathbf N=\begin{pmatrix}2&1\\ 0&3\\ 1&-1\end{pmatrix} is 3×23\times2. Find MN\mathbf{MN}.

A\mathbf A is 3×23\times2 and B\mathbf B is 2×42\times4. What is the order of AB\mathbf{AB}?

Matrices in real situations

Matrix multiplication organises totals, such as takings from sales and prices.

If S\mathbf S shows items sold (rows: shops, columns: products) and P\mathbf P is a column of prices, then SP\mathbf{SP} gives the takings of each shop.

A matrix scaled by 1.21.2 models a 20%20\% rise in every entry. Always say what the rows and columns mean, and what assumptions the model makes.

0200400600800100012001400DubaiSharjahAED
Takings of each shop (AED)

Worked example

S=(12080409010060)\mathbf S=\begin{pmatrix}120&80&40\\ 90&100&60\end{pmatrix} and P=(2512)\mathbf P=\begin{pmatrix}2\\ 5\\ 12\end{pmatrix}. Find SP\mathbf{SP}.

A matrix of prices is multiplied by 1.2. What does this model?

Adjacency matrices

It records the number of direct routes between each pair of vertices in a network.

A network is made of points (vertices) joined by lines (edges).

Its adjacency matrix has one row and column for each vertex. The entry is the number of direct routes between the two vertices: 1 if joined and 0 if not. For a two-way network the matrix is symmetrical.

Reading in the order W,X,Y,ZW,X,Y,Z gives M\mathbf M.

WXYZ
Towns W, X, Y and Z with routes WX, WY, XY and YZ

M=(0110101011010010)\mathbf M=\begin{pmatrix}0&1&1&0\\ 1&0&1&0\\ 1&1&0&1\\ 0&0&1&0\end{pmatrix}

Why is the adjacency matrix of a two-way network symmetrical?

Counting paths

The entries of Mn\mathbf M^n give the number of journeys that use exactly nn routes.

For M2\mathbf M^2, each entry is a row of M\mathbf M times a column of M\mathbf M. For three routes, work out M3=MM2\mathbf M^3=\mathbf M\mathbf M^2.

Check a count by listing the journeys. It should match the entry.

  • Entries of Mⁿjourneys using exactly n routes

M2=(2111121111301101)\mathbf M^2=\begin{pmatrix}2&1&1&1\\ 1&2&1&1\\ 1&1&3&0\\ 1&1&0&1\end{pmatrix}

Reading the answer

Use M2\mathbf M^2 to count two-route journeys from WW to ZZ and from YY to YY.

Using M², how many two-route journeys go from X to Z?

Try an exam question

A=(1230)\mathbf A=\begin{pmatrix}1&2\\ 3&0\end{pmatrix} and B=(21−14)\mathbf B=\begin{pmatrix}2&1\\ -1&4\end{pmatrix}. Find A+B\mathbf A+\mathbf B and AB\mathbf{AB}.

[4 marks]

That's the notes covered.

Carry on to the next subtopic.

Try a question

Find 2A−B2\mathbf A-\mathbf B.

1 mark, marked against the mark scheme

Revision notes