1.14 · AHL · HL onlyPaper 1Paper 2Paper 3

Matrices, determinants and inverses

In a minute

A is a table of numbers you can add, scale and multiply. Matrices total whole tables of costs at once, solve systems of equations with an , and code messages. Your GDC does the arithmetic; you set them up and interpret.

You'll be able to

  • Describe a matrix by its order and elements, and add, subtract and scale matrices by hand and with your GDC.
  • Multiply matrices, decide when a product exists, and use products to total costs.
  • Use the rules for matrix products, including that order matters, and the matrices II and 00.
  • Find and inverses of 2×22 \times 2 matrices by hand, and of larger ones with your GDC.
  • Write a as Ax=bA\boldsymbol{x} = \boldsymbol{b} and solve it with A−1A^{-1}.
  • Code and decode messages with a key matrix and its inverse.
Before you start2 quick questions on what this builds on
Check yourself
Solve the system 2x+y=112x + y = 11 and x−y=1x - y = 1.
Check yourself
Work out 3×4+2×(−5)+1×63 \times 4 + 2 \times (-5) + 1 \times 6.

Revise first: 1.8 Solving equations with technology

Matrices: order, elements and algebra

A bike shop's two branches, North and South, sell city, mountain and electric bikes. One week's sales fit in a table with a row for each branch and a column for each type.

As a , the table is S=(12749116)S = \begin{pmatrix}12 & 7 & 4\\9 & 11 & 6\end{pmatrix}. The element in row 2, column 3, s23=6s_{23} = 6, says South sold 66 electric bikes.

Two matrices are equal when they have the same order and all matching elements are equal.

Worked exampleThe shop's sales the next week are T=(15538139)T = \begin{pmatrix}15 & 5 & 3\\8 & 13 & 9\end{pmatrix}, with the same rows and columns as S=(12749116)S = \begin{pmatrix}12 & 7 & 4\\9 & 11 & 6\end{pmatrix}. Write down the order of SS, find S+TS + T, and interpret its element in row 1, column 2.

Try it first, then reveal one step at a time.

  1. SS has 22 rows and 33 columns, so its order is 2×32 \times 3. TT has the same order, so S+TS + T exists.

On your GDC, store each matrix once, then type sums and multiples using the stored names.

Worked exampleC=(8.5011.0014.509.0012.5015.00)C = \begin{pmatrix}8.50 & 11.00 & 14.50\\9.00 & 12.50 & 15.00\end{pmatrix} gives the prices in dollars of small, medium and large pizzas (columns) at two restaurants (rows). Every price rises by 6%6\%. Use your GDC to find the new prices.

Try it first, then reveal one step at a time.

  1. A 6%6\% rise multiplies each price by 1.061.06. Store CC, then enter the scalar multiple 1.06C1.06C.
Check yourself
A matrix holds the scores of 55 students in 33 tests, one row per student. What is its order?
Check yourself
2(x314)−(510y)=(9523)2\begin{pmatrix}x & 3\\1 & 4\end{pmatrix} - \begin{pmatrix}5 & 1\\0 & y\end{pmatrix} = \begin{pmatrix}9 & 5\\2 & 3\end{pmatrix}. Find x+yx + y.

Multiplying matrices

A café sold 4040 coffees, 2525 teas and 1818 cakes on Saturday, at 3.203.20, 2.502.50 and 4.004.00 dollars each. Its takings, 40(3.20)+25(2.50)+18(4.00)40(3.20) + 25(2.50) + 18(4.00), are a row of amounts times a column of prices.

That is : each row of one matrix times each column of another.

Q (2 × 3) P (3 × 1) QP (2 × 1) 40 25 18 52 30 24 × 3.20 2.50 4.00 = 262.50 337.40 Row 1 times the column: 40 × 3.20 + 25 × 2.50 + 18 × 4.00 = 262.50
Row 1 of QQ times the column PP gives row 1 of QPQP.
Worked exampleThe café's sales are Q=(402518523024)Q = \begin{pmatrix}40 & 25 & 18\\52 & 30 & 24\end{pmatrix} (rows Saturday and Sunday; columns coffee, tea, cake) and its prices in dollars are P=(3.202.504.00)P = \begin{pmatrix}3.20\\2.50\\4.00\end{pmatrix}. Find QPQP and interpret it.

Try it first, then reveal one step at a time.

  1. Write the orders side by side: (2×3)(3×1)(2 \times 3)(3 \times 1). The inside numbers match, and the outside numbers give the order of QPQP, 2×12 \times 1.
Worked exampleM=(411923612)M = \begin{pmatrix}4 & 1 & 1\\9 & 2 & 3\\6 & 1 & 2\end{pmatrix} gives the planks, screw packs and varnish tins (columns) for a chair, a table and a shelf (rows). C=(7.506.603.204.1011.0013.40)C = \begin{pmatrix}7.50 & 6.60\\3.20 & 4.10\\11.00 & 13.40\end{pmatrix} gives the material prices in dollars (rows) at suppliers X and Y. Use your GDC to find the cost of 1010 chairs, 44 tables and 66 shelves at each supplier.

Try it first, then reveal one step at a time.

  1. MCMC is (3×3)(3×2)=3×2(3 \times 3)(3 \times 2) = 3 \times 2: the cost of one item at each supplier. The GDC gives MC=(44.243.9106.9107.870.270.5)MC = \begin{pmatrix}44.2 & 43.9\\106.9 & 107.8\\70.2 & 70.5\end{pmatrix}.
Check yourself
AA is a 2×32 \times 3 matrix and BB is a 3×43 \times 4 matrix. What is the order of ABAB?
Check yourself
Find the element in row 2, column 1 of (2−13041)(512−2−16)\begin{pmatrix}2 & -1 & 3\\0 & 4 & 1\end{pmatrix}\begin{pmatrix}5 & 1\\2 & -2\\-1 & 6\end{pmatrix}.

Rules for products, and the matrices I and 0

With numbers, 3×5=5×33 \times 5 = 5 \times 3. With matrices, ABAB and BABA pair different rows and columns, so the order usually matters.

Worked exampleA=(2103)A = \begin{pmatrix}2 & 1\\0 & 3\end{pmatrix} and B=(142−1)B = \begin{pmatrix}1 & 4\\2 & -1\end{pmatrix}. Find ABAB and BABA, and comment.

Try it first, then reveal one step at a time.

  1. ABAB: row 1 of AA gives 2(1)+1(2)=42(1) + 1(2) = 4 and 2(4)+1(−1)=72(4) + 1(-1) = 7. Row 2 gives 0(1)+3(2)=60(1) + 3(2) = 6 and 0(4)+3(−1)=−30(4) + 3(-1) = -3.

The 2×22 \times 2 identity is I=(1001)I = \begin{pmatrix}1 & 0\\0 & 1\end{pmatrix}. The zero matrix 00 has every element 00: A+0=AA + 0 = A when the orders match, and any product with 00, when it exists, is a zero matrix.

Worked exampleTickets at a cinema cost P=(1179)P = \begin{pmatrix}11 & 7 & 9\end{pmatrix} euros (adult, child, senior). Sales at its two screens in two weeks are W1=(1209564803022)W_1 = \begin{pmatrix}120 & 95\\64 & 80\\30 & 22\end{pmatrix} and W2=(1348870912530)W_2 = \begin{pmatrix}134 & 88\\70 & 91\\25 & 30\end{pmatrix} (rows adult, child, senior; columns screen 1, screen 2). Find each screen's ticket income over the two weeks.

Try it first, then reveal one step at a time.

  1. Income is PW1+PW2PW_1 + PW_2, which equals P(W1+W2)P(W_1 + W_2) by the distributive law: one product instead of two.
Check yourself
Which law does matrix multiplication not obey in general?
Check yourself
MM is a 2×32 \times 3 matrix. What is the order of the identity matrix II with IM=MIM = M?

Determinants and inverses

Matrices have no division. Instead, a square matrix AA may have an A−1A^{-1} that undoes it, as 15\frac{1}{5} undoes 55. One number decides whether it does.

In the formula booklet
A=(abcd)⇒det⁡A=∣A∣=ad−bcA = \begin{pmatrix} a & b\\ c & d \end{pmatrix} \Rightarrow \det A = |A| = ad - bc
In the formula booklet
A=(abcd)⇒A−1=1det⁡A(d−b−ca), ad≠bcA = \begin{pmatrix} a & b\\ c & d \end{pmatrix} \Rightarrow A^{-1} = \frac{1}{\det A}\begin{pmatrix} d & -b\\ -c & a \end{pmatrix},\ ad \neq bc

Both are in the booklet. In words: swap aa and dd, negate bb and cc, divide by det⁡A\det A. If det⁡A=0\det A = 0, AA is singular: it has no inverse.

For 3×33 \times 3 and larger matrices, use your GDC for both. Check an inverse by multiplying: AA−1AA^{-1} must be II.

Worked exampleFind A−1A^{-1} by hand for A=(5342)A = \begin{pmatrix}5 & 3\\4 & 2\end{pmatrix}, and check it.

Try it first, then reveal one step at a time.

  1. det⁡A=5(2)−3(4)=−2\det A = 5(2) - 3(4) = -2. This is not 00, so A−1A^{-1} exists.
Worked exampleN=(3−1214025−3)N = \begin{pmatrix}3 & -1 & 2\\1 & 4 & 0\\2 & 5 & -3\end{pmatrix}. Use your GDC to find det⁡N\det N. Does NN have an inverse? If so, find it.

Try it first, then reveal one step at a time.

  1. Store NN, then use the determinant command: det⁡N=−45\det N = -45.
Check yourself
Find det⁡(−352−4)\det \begin{pmatrix}-3 & 5\\2 & -4\end{pmatrix}.
Check yourself
A code uses the key K=(k623)K = \begin{pmatrix}k & 6\\2 & 3\end{pmatrix}. For which kk could messages coded with KK not be decoded?

Solving systems with an inverse matrix

In 1.8 you solved a with your GDC's solver. Matrices give another method. Since (234−1)(xy)=(2x+3y4x−y)\begin{pmatrix}2 & 3\\4 & -1\end{pmatrix}\begin{pmatrix}x\\y\end{pmatrix} = \begin{pmatrix}2x + 3y\\4x - y\end{pmatrix}, the system 2x+3y=132x + 3y = 13, 4x−y=54x - y = 5 is one matrix equation: (234−1)(xy)=(135)\begin{pmatrix}2 & 3\\4 & -1\end{pmatrix}\begin{pmatrix}x\\y\end{pmatrix} = \begin{pmatrix}13\\5\end{pmatrix}.

In exams, AA always has an inverse when you solve a system this way. The exception is finding eigenvectors in 1.15.

Worked exampleA school play sold 230230 tickets for 17101710 dollars. Adult tickets cost 99 dollars and student tickets 66 dollars. Write the system as Ax=bA\boldsymbol{x} = \boldsymbol{b} and solve it with A−1A^{-1}, found by hand.

Try it first, then reveal one step at a time.

  1. Let aa and ss be the numbers of adult and student tickets: a+s=230a + s = 230 and 9a+6s=17109a + 6s = 1710. So (1196)(as)=(2301710)\begin{pmatrix}1 & 1\\9 & 6\end{pmatrix}\begin{pmatrix}a\\s\end{pmatrix} = \begin{pmatrix}230\\1710\end{pmatrix}.
Worked examplePer kilogram, feeds X, Y and Z give these grams of protein, fibre and fat: X 120120, 150150, 4040; Y 200200, 6060, 9090; Z 8080, 250250, 3030. A farmer needs 19201920 g of protein, 23902390 g of fibre and 750750 g of fat. Use an inverse matrix to find the kilograms of each feed.

Try it first, then reveal one step at a time.

  1. Let xx, yy, zz be the kilograms of X, Y, Z. One equation per nutrient gives (1202008015060250409030)(xyz)=(19202390750)\begin{pmatrix}120 & 200 & 80\\150 & 60 & 250\\40 & 90 & 30\end{pmatrix}\begin{pmatrix}x\\y\\z\end{pmatrix} = \begin{pmatrix}1920\\2390\\750\end{pmatrix}.
Check yourself
Which matrix AA writes 4x−y=94x - y = 9, x+3y=12x + 3y = 12 as A(xy)=bA\begin{pmatrix}x\\y\end{pmatrix} = \boldsymbol{b}?
Check yourself
44 pens and 33 notebooks cost 1212 dollars; 22 pens and 55 notebooks cost 1313 dollars. Use an inverse matrix to find the price of a notebook, in dollars.

Coding and decoding messages

To code a word, turn each letter into a number, A=1A = 1 to Z=26Z = 26, with a space =0= 0. Then hide the numbers with a key matrix KK.

1. Write the numbers in pairs as the columns of a matrix MM with 22 rows. Add a space if the count is odd.

2. Encode: send the numbers of C=KMC = KM, column by column.

3. Decode: work out K−1C=K−1KM=MK^{-1}C = K^{-1}KM = M, and turn the numbers back into letters. This needs det⁡K≠0\det K \neq 0, so that K−1K^{-1} exists.

ROAD A = 1, … Z = 26 message M 18 1 15 4 encode: C = KM decode: M = K⁻¹C code C (sent) 69 7 120 13 Key K has rows 3, 1 and 5, 2, so det K = 1. The code is sent column by column: 69, 120, 7, 13.
KK on the left codes the message; K−1K^{-1} on the left undoes it.

A key of whole numbers with det⁡K=1\det K = 1 or −1-1 has a whole-number inverse, which makes decoding by hand easy.

Worked exampleUse the key K=(3152)K = \begin{pmatrix}3 & 1\\5 & 2\end{pmatrix} to encode the word ROAD.

Try it first, then reveal one step at a time.

  1. R =18= 18, O =15= 15, A =1= 1, D =4= 4. The pairs RO and AD are the columns: M=(181154)M = \begin{pmatrix}18 & 1\\15 & 4\end{pmatrix}.
Worked exampleA message was coded with K=(2312)K = \begin{pmatrix}2 & 3\\1 & 2\end{pmatrix}. The numbers received, column by column, are 29,15,89,5429, 15, 89, 54. Decode it.

Try it first, then reveal one step at a time.

  1. Rebuild the code matrix: C=(29891554)C = \begin{pmatrix}29 & 89\\15 & 54\end{pmatrix}.
Check yourself
The key K=(4131)K = \begin{pmatrix}4 & 1\\3 & 1\end{pmatrix} encodes the pair HI, which is (89)\begin{pmatrix}8\\9\end{pmatrix}. What is the second number of the code?
Check yourself
A word was coded with K=(1213)K = \begin{pmatrix}1 & 2\\1 & 3\end{pmatrix}, so K−1=(3−2−11)K^{-1} = \begin{pmatrix}3 & -2\\-1 & 1\end{pmatrix}. The code matrix received is C=(17372255)C = \begin{pmatrix}17 & 37\\22 & 55\end{pmatrix}. What is the word?

Common mistakes

  • Multiplying in the wrong order. ABAB and BABA are usually different, so keep the order the question gives; the right matrices in the wrong order lose the accuracy mark.
  • Putting the right numbers in the wrong places. Decide what each row and column stands for, and keep that order in every matrix you multiply.
  • Writing x=bA−1\boldsymbol{x} = \boldsymbol{b}A^{-1}. That product isn't defined; multiply on the left, x=A−1b\boldsymbol{x} = A^{-1}\boldsymbol{b}.
  • Getting the 2×22 \times 2 inverse half right: swapping bb and cc instead of aa and dd, or not dividing by det⁡A\det A. Check that AA−1=IAA^{-1} = I.
  • Rounding an inverse before using it. Keep the GDC's full values, or let the GDC work out A−1bA^{-1}\boldsymbol{b} in one step.

Exam tips

  • "Write down" a matrix from a context: the right values earn the method mark, and the right values in the right places earn the accuracy mark.
  • "Find" with the GDC: write down the product, or A−1bA^{-1}\boldsymbol{b}, that you entered before the answer. Give values exactly or to 3 s.f., and money to 2 d.p.
  • "Show that" for a 2×22 \times 2 determinant or inverse: write the ad−bcad - bc line with the numbers in, and end on the given result.
  • "Hence" decode or solve: use the inverse you just found. A wrong inverse used correctly can still earn follow-through marks.

Key takeaways

In bookletA=(abcd)⇒det⁡A=∣A∣=ad−bcA = \begin{pmatrix} a & b\\ c & d \end{pmatrix} \Rightarrow \det A = |A| = ad - bc
In bookletA=(abcd)⇒A−1=1det⁡A(d−b−ca), ad≠bcA = \begin{pmatrix} a & b\\ c & d \end{pmatrix} \Rightarrow A^{-1} = \frac{1}{\det A}\begin{pmatrix} d & -b\\ -c & a \end{pmatrix},\ ad \neq bc
Learn thisOrder m×nm \times n means mm rows and nn columns. Add or subtract matrices of the same order element by element; kAkA multiplies every element by kk.
Learn thisABAB exists only when AA has as many columns as BB has rows: (m×n)(n×p)(m \times n)(n \times p) gives m×pm \times p. Each element is a row of AA times a column of BB.
Learn thisWhen the products are defined, (AB)C=A(BC)(AB)C = A(BC) and A(B+C)=AB+ACA(B + C) = AB + AC, but in general AB≠BAAB \neq BA.
Learn thisAI=IA=AAI = IA = A for a square matrix AA and the identity II of the same order; A+0=AA + 0 = A for the zero matrix of the same order.
Learn thisA square matrix AA has an inverse only when det⁡A≠0\det A \neq 0; then AA−1=A−1A=IAA^{-1} = A^{-1}A = I.
Learn thisnn linear equations in nn unknowns form Ax=bA\boldsymbol{x} = \boldsymbol{b}. If det⁡A≠0\det A \neq 0, the solution is x=A−1b\boldsymbol{x} = A^{-1}\boldsymbol{b}, with A−1A^{-1} on the left.
Learn thisCoding: send C=KMC = KM, with the letter numbers in the columns of MM. Decoding: M=K−1CM = K^{-1}C, which needs det⁡K≠0\det K \neq 0.

Practise this

10 past-paper questions on Matrices and determinants in the AI HL bank, each with a mark scheme and a worked explanation.

Practise Matrices and determinants →