Matrices
View .md

Matrix Multiplication

Matrix multiplication combines two matrices to produce a new matrix.

The Rule

For C=ABC = AB, each element is a dot product:

cij=row i of A⋅column j of Bc_{ij} = \text{row } i \text{ of } A \cdot \text{column } j \text{ of } B

Dimensions

  • AA is m×nm \times n, BB is n×pn \times p
  • CC is m×pm \times p
  • The inner dimensions must match

Four Ways to Multiply

  1. Row × Column — the standard dot product
  2. Column picture — ABAB = linear combination of AA’s columns
  3. Row picture — each row of CC = linear combination of BB’s rows
  4. Column × Row — sum of rank-1 matrices

Properties

  • Not commutative: AB≠BAAB \neq BA (usually)
  • Associative: (AB)C=A(BC)(AB)C = A(BC)
  • Distributive: A(B+C)=AB+ACA(B + C) = AB + AC