Linear algebra and discrete math · University

Matrix multiplication

AB ≠ BA

The idea

Row by column: each number in the answer is “a row of A” dotted with “a column of B”.

The board

  1. Element (i, j) of AB = row i of A · column j of B.
  2. 12345678: top left = 1 · 5 + 2 · 7 = 19.
  3. Meaning: AB = apply B first, then A.
  4. Careful: AB ≠ BA in general. Socks then shoes ≠ the other way around.

The most common mistake

Multiplying element by element. That's not matrix multiplication.

The trick

Sizes: (m × n) · (n × p) = (m × p). The inner ones must match.

Problems

1001 · A = ?

  • 0
  • 2A
  • Aᵀ
  • A
Show the answer

A — The identity matrix changes nothing.

(2 × 3) · (3 × 5) gives…

  • 2 × 5
  • 3 × 3
  • impossible
  • 5 × 2
Show the answer

2 × 5 — The outer sizes.

Take the lesson · exercises and XPFree, no sign-up needed.

You need to know

Leads to