Skip to main content

Unit 4 · Topic 4.10

4.10 Matrices

A matrix is a rectangular grid of numbers. You can multiply two matrices when the first has as many columns as the second has rows, and each entry of the product is the dot product of a row of the first matrix with a column of the second.

Key terms

  • matrix
  • dimensions (rows × columns)
  • matrix multiplication
  • entry

Matrices and their dimensions

An n × m matrix (read “n by m”) has n rows and m columns. Rows run across; columns run down. The entry in row i and column j is often called aᵢⱼ.

In these notes, a matrix is written row by row, with semicolons between rows: [1 2; 3 4] has first row 1, 2 and second row 3, 4. It is a 2 × 2 matrix.

A single vector ⟨a, b⟩ can be written as a 2 × 1 matrix, a column: [a; b].

When can you multiply?

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

A quick check: write the dimensions side by side, like (2 × 3)(3 × 2). The inside numbers must match, and the outside numbers give the size of the product, 2 × 2.

How to multiply

The entry in row i, column j of AB is the dot product of row i of A with column j of B: multiply matching entries and add.

For A = [1 2; 3 4] and B = [0 −1; 5 2], row 1 of A times column 1 of B is 1(0) + 2(5) = 10. Doing all four gives AB = [10 3; 20 5].

Why this definition? Row-times-column is exactly how totals are computed. If a row lists prices, 3 dollars and 5 dollars per item, and a column lists quantities, 4 and 2 items, the product is 3(4) + 5(2) = 22 dollars. A bigger matrix product just does many of these totals at once.

Order matters

Matrix multiplication is not commutative. Usually AB ≠ BA, and sometimes one product exists while the other doesn't.

For the matrices above, BA = [−3 −4; 11 18], which is different from AB.

Matrix multiplication does follow other familiar rules, such as (AB)C = A(BC). Matrices of the same size can also be added entry by entry, and a whole matrix can be multiplied by a number entry by entry.

Multiplying by the identity matrix, [1 0; 0 1] for 2 × 2 matrices, leaves a matrix unchanged. Topic 4.11 builds on this.

Worked examples

Try each one yourself first, then open the solution.

  1. Example 1

    Two products in both orders

    For A = [1 2; 3 4] and B = [0 −1; 5 2], find AB and BA.

    Show the solution
    1. Step 1: AB, row 1: (1)(0) + (2)(5) = 10 and (1)(−1) + (2)(2) = 3. Row 2: (3)(0) + (4)(5) = 20 and (3)(−1) + (4)(2) = 5.
    2. Step 2: BA, row 1: (0)(1) + (−1)(3) = −3 and (0)(2) + (−1)(4) = −4. Row 2: (5)(1) + (2)(3) = 11 and (5)(2) + (2)(4) = 18.

    Answer: AB = [10 3; 20 5] and BA = [−3 −4; 11 18], so AB ≠ BA.

  2. Example 2

    Checking dimensions

    A is 2 × 3, B is 3 × 2 and C is 2 × 2. Which of AB, BA, AC and CA are defined, and what are their sizes?

    Show the solution
    1. Step 1: AB: (2 × 3)(3 × 2), inner 3 = 3, so it's 2 × 2.
    2. Step 2: BA: (3 × 2)(2 × 3), inner 2 = 2, so it's 3 × 3.
    3. Step 3: AC: (2 × 3)(2 × 2), inner 3 ≠ 2, so it's undefined.
    4. Step 4: CA: (2 × 2)(2 × 3), inner 2 = 2, so it's 2 × 3.

    Answer: AB is 2 × 2, BA is 3 × 3, AC is undefined, CA is 2 × 3.

  3. Example 3

    Trap: multiplying entry by entry

    Compute [2 −1 0; 1 3 4] times the column [3; 1; −2].

    Show the solution
    1. Step 1: (2 × 3)(3 × 1) gives a 2 × 1 result.
    2. Step 2: Row 1 · column: 2(3) + (−1)(1) + 0(−2) = 5.
    3. Step 3: Row 2 · column: 1(3) + 3(1) + 4(−2) = −2.
    4. Step 4: Multiplying matching positions without adding across the row is not matrix multiplication.

    Answer: [5; −2]

Common mistakes

  • Assuming AB = BA.
  • Multiplying matrices entry by entry instead of row times column.
  • Writing dimensions as columns × rows. It's always rows first.

On the exam

  • Unit 4 is not on the AP Precalculus Exam, so you'll see this topic on class tests rather than in May.
  • Expect to state whether a product is defined, give its dimensions, and compute 2 × 2 products by hand. Technology can handle larger ones.

Connected topics

Videos

  • AP Precalculus – 4.10 Matrices

    The AlgebrosWatch on YouTube (opens in a new tab)

  • Matrix multiplication introduction | Matrices | Precalculus | Khan Academy

    Khan AcademyWatch on YouTube (opens in a new tab)

  • 4.10-A Matrices Video

    Flamingo Math by Jean AdamsWatch on YouTube (opens in a new tab)

  • How To Multiply Matrices - Quick & Easy!

    The Organic Chemistry TutorWatch on YouTube (opens in a new tab)

  • Matrix Multiplication and Associated Properties

    Professor Dave ExplainsWatch on YouTube (opens in a new tab)

Check yourself

3 questions on 4.10 Matrices. Pick an answer to see if you got it, and why.

Question 1 of 3

Matrices are written row by row, with rows separated by semicolons, so [a b; c d] has first row a, b and second row c, d. Let A = [2 −1; 0 3] and B = [1 4; −2 5]. What is AB?

Question 2 of 3

Matrix A has dimensions 2 × 3 (2 rows and 3 columns), and matrix B has dimensions 3 × 4. Which of the following is true?

Question 3 of 3

Matrices are written row by row, with rows separated by semicolons. Let A = [1 2; 3 4] and B = [5 −1; 1 2]. What is the entry in row 2, column 2 of AB?

0 of 3 answered