Unit 4 Topic 4.10

Matrices

see every function move

3 min readfreeNot practiced

Beyond the exam. The AP® Precalculus exam does not test this unit. Many classes teach it, and it prepares you for calculus.

A matrix (plural matrices) is a rectangle of numbers arranged in rows and columns. Matrices organize data, like sales by day and item, and later in this unit they turn into functions that move, rotate and stretch the plane. This page covers the language and the arithmetic, above all how to multiply.

Dimensions and entries

A matrix with mm rows and nn columns has dimensions m×nm \times n (say "m by n"), rows first. The entry in row ii and column jj is written aija_{ij}.

A=[3−14025]A = \left[ \begin{matrix} 3 & -1 & 4 \\ 0 & 2 & 5 \end{matrix} \right]

is 2×32 \times 3, and a13=4a_{13} = 4 (row 1, column 3). A matrix with one column, such as [5−1]\left[ \begin{matrix} 5 \\ -1 \end{matrix} \right], is a column vector.

Adding and scaling

Matrices with the same dimensions add entry by entry, and a number times a matrix multiplies every entry:

[1−204]+[312−1]=[4−123],3[1−204]=[3−6012].\left[ \begin{matrix} 1 & -2 \\ 0 & 4 \end{matrix} \right] + \left[ \begin{matrix} 3 & 1 \\ 2 & -1 \end{matrix} \right] = \left[ \begin{matrix} 4 & -1 \\ 2 & 3 \end{matrix} \right], \qquad 3\left[ \begin{matrix} 1 & -2 \\ 0 & 4 \end{matrix} \right] = \left[ \begin{matrix} 3 & -6 \\ 0 & 12 \end{matrix} \right].

Multiplying: row times column

The product ABAB is defined when the number of columns of AA equals the number of rows of BB. If AA is m×nm \times n and BB is n×pn \times p, then ABAB is m×pm \times p: the outside numbers give the size, the inside numbers must match.

To find the entry in row ii, column jj of ABAB, take row ii of AA and column jj of BB, multiply matching entries and add, just like a dot product.

Matrix A with rows (2, -1) and (0, 3) times matrix B with rows (1, 4) and (-2, 1) equals the product with rows (4, 7) and (-6, 3). Row 1 of A and column 2 of B are highlighted, and the entry 7 in row 1, column 2 of the product is boxed: 2 times 4 plus (-1) times 1 = 7.
Figure 1. Row 1 of AA times column 2 of BB gives the entry in row 1, column 2 of ABAB. LevlPrep original diagram.

Worked example 1. Find ABAB for A=[2−103]A = \left[ \begin{matrix} 2 & -1 \\ 0 & 3 \end{matrix} \right] and B=[14−21]B = \left[ \begin{matrix} 1 & 4 \\ -2 & 1 \end{matrix} \right].

Row 1, column 1: 2(1)+(−1)(−2)2(1) + (-1)(-2)=2+2= 2 + 2=4= 4. Row 1, column 2: 2(4)+(−1)(1)=72(4) + (-1)(1) = 7.

Row 2, column 1: 0(1)+3(−2)=−60(1) + 3(-2) = -6. Row 2, column 2: 0(4)+3(1)=30(4) + 3(1) = 3.

So AB=[47−63]AB = \left[ \begin{matrix} 4 & 7 \\ -6 & 3 \end{matrix} \right]. In the other order, BA=[211−45]BA = \left[ \begin{matrix} 2 & 11 \\ -4 & 5 \end{matrix} \right]: a different matrix. Order matters.

Matrices in context

Worked example 2. A food truck sells burgers, fries and drinks at $6, $3 and $2. On Saturday it sells 4040, 6565 and 9090; on Sunday 5555, 5050 and 7070. Find each day's revenue.

Put the sales in a 2×32 \times 3 matrix (one row per day) and the prices in a 3×13 \times 1 column:

[406590555070][632]=[40(6)+65(3)+90(2)55(6)+50(3)+70(2)]=[615620].\left[ \begin{matrix} 40 & 65 & 90 \\ 55 & 50 & 70 \end{matrix} \right]\left[ \begin{matrix} 6 \\ 3 \\ 2 \end{matrix} \right] = \left[ \begin{matrix} 40(6) + 65(3) + 90(2) \\ 55(6) + 50(3) + 70(2) \end{matrix} \right] = \left[ \begin{matrix} 615 \\ 620 \end{matrix} \right].

Saturday brought in $615 and Sunday $620. The inside dimensions match (33 and 33) and the result is 2×12 \times 1, one revenue per day.

Rules to keep straight

OperationWhen it is definedResult
A+BA + Bsame dimensionssame dimensions, entry by entry
kAkAany matrixevery entry times kk
ABABcolumns of AA = rows of BBrows of AA by columns of BB

The identity matrix I=[1001]I = \left[ \begin{matrix} 1 & 0 \\ 0 & 1 \end{matrix} \right] plays the role of the number 11: AI=IA=AAI = IA = A for every 2×22 \times 2 matrix AA. Unlike numbers, though, ABAB and BABA are usually different, so always multiply in the order the problem gives.

Spot a mistake on this page?