lacunary - Mathnotes

Matrices

Matrix Multiplication

Definition: matrix product (also: product, matrix multiplication) \@{matrix-product}

Let A be an m×n matrix and B be an n×p matrix. We define the product of A an B, denoted AB, to be the m×p matrix such that

(AB)i,j=∑k=1nAi,kBk,jfor 1≤i≤m,1≤j≤p.

Note \@{note-3}

(AB)i,j is the @sum of products of corresponding entries from the ith @row of A and the jth @column of B.

The following mnemonic is helpful:

(m×n)⋅(n×p)=(m×p).

We can view the matrix product AB=C in (at least) four different ways:

  1. Each entry of C is a dot product: The entry Ci,j=(row i of A)⋅(column j of B)=∑k=1nAi,kBk,j.
  2. Each column of C is A times the corresponding column of B: C⋅,j=AB⋅,j, so C⋅,j=B1,jA⋅,1+⋯+Bn,jA⋅,n In other words, the columns of C are linear combinations of the columns of A.
  3. Each row of C is the corresponding row of A multiplied by B: Ci,⋅=Ai,⋅B, so Ci,⋅=Ai,1B1,⋅+⋯+Ai,nBn,⋅. In other words, the rows of C are linear combinations of the rows of B.
  4. C is a sum of column × row outer products: C=AB=a1b1⊤+asb2⊤+⋯+anbn⊤.