Number and Quantity · Lesson 5

Matrix operations

Lesson 3 found single entries. Here you work with whole matrices. Adding, subtracting and scaling work entry by entry, so a matrix equation such as 2X+A=B2X + A = B is solved like a linear equation: subtract AA from both sides, then divide every entry by 2, so X=12(B−A)X = \frac{1}{2}(B - A).

Before you multiply, check the inner dimensions: an m×nm \times n matrix times an n×pn \times p matrix is defined, and the product is m×pm \times p. Each entry of ABAB is a row of AA times a column of BB: multiply matching entries and add. A 1×31 \times 3 row times a 3×13 \times 1 column is a single number. Order matters: ABAB and BABA are usually different, and one can exist while the other does not.

The determinant of [abcd]\begin{bmatrix} a & b \\ c & d \end{bmatrix} is ad−bcad - bc: the top-left to bottom-right product minus the top-right to bottom-left product. A 2×22 \times 2 matrix has an inverse exactly when its determinant is not 0, so a question about a matrix with no inverse is a question about setting ad−bc=0ad - bc = 0.

When a matrix operation is defined
OperationNeedsResult
A+BA + B or A−BA - BSame dimensionsSame dimensions as AA
kAkAAny matrixSame dimensions as AA
ABAB (AA is m×nm \times n)Columns of AA = rows of BB (BB is n×pn \times p)An m×pm \times p matrix
DeterminantA square matrix (here 2×22 \times 2)A number, ad−bcad - bc

Worked example Easy

Matrices AA and BB are shown below.

A=[3−142]B=[95−28]A = \begin{bmatrix} 3 & -1 \\ 4 & 2 \end{bmatrix} \quad B = \begin{bmatrix} 9 & 5 \\ -2 & 8 \end{bmatrix}

Matrix XX satisfies the equation 2X+A=B2X + A = B. Which of the following is XX?

  1. [6215]\begin{bmatrix} 6 & 2 \\ 1 & 5 \end{bmatrix}
  2. [66−66]\begin{bmatrix} 6 & 6 \\ -6 & 6 \end{bmatrix}
  3. [1212−1212]\begin{bmatrix} 12 & 12 \\ -12 & 12 \end{bmatrix}
  4. [33−33]\begin{bmatrix} 3 & 3 \\ -3 & 3 \end{bmatrix}Answer

How to solve it

  1. Subtract AA from both sides: 2X=B−A2X = B - A.
  2. Subtract entry by entry: B−A=[9−35−(−1)−2−48−2]=[66−66]B - A = \begin{bmatrix} 9 - 3 & 5 - (-1) \\ -2 - 4 & 8 - 2 \end{bmatrix} = \begin{bmatrix} 6 & 6 \\ -6 & 6 \end{bmatrix}.
  3. Divide every entry by 2: X=[33−33]X = \begin{bmatrix} 3 & 3 \\ -3 & 3 \end{bmatrix}.

Why each choice is right or wrong

  • A. Incorrect. [6215]\begin{bmatrix} 6 & 2 \\ 1 & 5 \end{bmatrix} is 12(B+A)\frac{1}{2}(B + A). Moving AA to the other side subtracts it: 2X=B−A2X = B - A.
  • B. Incorrect. [66−66]\begin{bmatrix} 6 & 6 \\ -6 & 6 \end{bmatrix} is B−AB - A, which equals 2X2X. One step remains: divide every entry by 2.
  • C. Incorrect. [1212−1212]\begin{bmatrix} 12 & 12 \\ -12 & 12 \end{bmatrix} is 2(B−A)2(B - A). Undoing 2X2X means dividing by 2, not multiplying.
  • D. Correct. 2X=B−A=[66−66]2X = B - A = \begin{bmatrix} 6 & 6 \\ -6 & 6 \end{bmatrix}, so X=[33−33]X = \begin{bmatrix} 3 & 3 \\ -3 & 3 \end{bmatrix}. Check one entry: 2⋅3+3=92 \cdot 3 + 3 = 9, the top-left entry of BB.

Worked example Medium

Matrices AA and BB are shown below.

A=[1203]B=[2−114]A = \begin{bmatrix} 1 & 2 \\ 0 & 3 \end{bmatrix} \quad B = \begin{bmatrix} 2 & -1 \\ 1 & 4 \end{bmatrix}

Which of the following is the product ABAB?

  1. [47312]\begin{bmatrix} 4 & 7 \\ 3 & 12 \end{bmatrix}Answer
  2. [21114]\begin{bmatrix} 2 & 1 \\ 1 & 14 \end{bmatrix}
  3. [2−2012]\begin{bmatrix} 2 & -2 \\ 0 & 12 \end{bmatrix}
  4. [09−312]\begin{bmatrix} 0 & 9 \\ -3 & 12 \end{bmatrix}

How to solve it

  1. Row 1 of AA is (1,2)(1, 2). With column 1 of BB, (2,1)(2, 1): 1⋅2+2⋅1=41 \cdot 2 + 2 \cdot 1 = 4. With column 2, (−1,4)(-1, 4): 1⋅(−1)+2⋅4=71 \cdot (-1) + 2 \cdot 4 = 7.
  2. Row 2 of AA is (0,3)(0, 3). With column 1: 0⋅2+3⋅1=30 \cdot 2 + 3 \cdot 1 = 3. With column 2: 0⋅(−1)+3⋅4=120 \cdot (-1) + 3 \cdot 4 = 12.
  3. So AB=[47312]AB = \begin{bmatrix} 4 & 7 \\ 3 & 12 \end{bmatrix}.

Why each choice is right or wrong

  • A. Correct. Each entry is a row of AA times a column of BB: 1⋅2+2⋅1=41 \cdot 2 + 2 \cdot 1 = 4, 1⋅(−1)+2⋅4=71 \cdot (-1) + 2 \cdot 4 = 7, 0⋅2+3⋅1=30 \cdot 2 + 3 \cdot 1 = 3, and 0⋅(−1)+3⋅4=120 \cdot (-1) + 3 \cdot 4 = 12.
  • B. Incorrect. [21114]\begin{bmatrix} 2 & 1 \\ 1 & 14 \end{bmatrix} is BABA, the product in the other order. Matrix multiplication is not commutative, so keep AA first.
  • C. Incorrect. [2−2012]\begin{bmatrix} 2 & -2 \\ 0 & 12 \end{bmatrix} multiplies entries in matching positions, such as 1⋅21 \cdot 2 and 2⋅(−1)2 \cdot (-1). A product entry uses a whole row and a whole column.
  • D. Incorrect. [09−312]\begin{bmatrix} 0 & 9 \\ -3 & 12 \end{bmatrix} pairs rows of AA with rows of BB, for example 1⋅2+2⋅(−1)=01 \cdot 2 + 2 \cdot (-1) = 0. The second matrix contributes columns.

Trap Not entry by entry, and not in either order

Adding and scaling go entry by entry, but multiplying does not: multiplying matching entries is a different, wrong operation, and it shows up as a wrong choice. And AB≠BAAB \neq BA in general, so a choice that is the product in the other order is there to catch you. Keep the order the question gives.

Trap Determinant slips

The determinant ad−bcad - bc multiplies along the diagonals and subtracts. Adding the two products, multiplying across the rows, or multiplying down the columns each gives a value that matches a wrong choice. Say it as you work: top-left times bottom-right, minus top-right times bottom-left.

Calculator When a calculator isn’t faster

Plan on hand work. A full 2×22 \times 2 product is eight multiplications and four additions, and most questions ask for one matrix, a size, or a determinant. Whether your calculator handles matrices depends on the model, and typing the entries in often takes longer than the arithmetic. Use the calculator for a multiplication inside a step if the numbers are large.