Euler Hall — free maths guides

Read a column of AB as A times that column of B

Compute one column of AB as A times that column of B. The idea in plain words, a worked example, and a check with the answers shown — part of the free Linear Algebra guides.

Plain words first

WriteBB as a list of its columns:B=[ b1 b2 ⋯ bp ]B=[\,b_1\ b_2\ \cdots\ b_p\,]. Then

AB=[ Ab1 Ab2 ⋯ Abp ].AB=[\,Ab_1\ Ab_2\ \cdots\ Ab_p\,].

Columnjj of the product uses columnjj ofBB. EachAbjAb_j is the matrix-vector product you already know: rowii ofAA dotted with the whole ofbjb_j gives the entry in rowii of that column.

Why "column ofBB" and not "column ofAA"

A productAbAb makes sense exactly whenAA's row length equalsbb's length. A column ofBB has as many entries asBB has rows, and that is the numberAA's rows are long — the inner dimension. A column ofAA has as many entries asAA has rows, which is the dimension of the output. So a column ofAA lives in the output space and a column ofBB lives in the input space, and only the input one can be fed intoAA.

There is a second, deeper reason.BB's columns are the objects being acted on;AA is the action. Multiplying byAA does the same thing to whichever column you hand it, so the column ofABAB you get back is determined entirely by the column you hand in. Nothing aboutAA chooses an index.

Worked example, different numbers

Column 2 ofBB is(4,5,6)(4,5,6). Then

So column 2 ofABAB is(14,19)(14,19), andABAB is2×22\times2 becauseBB has two columns.

Read it again as a combination of columns ofAA:4 (2,1)+5 (0,3)+6 (1,0)=(14,19)4\,(2,1)+5\,(0,3)+6\,(1,0)=(14,19). Same answer, and this reading shows why the entries ofBB's column are the weights.

By the end you can
  • Compute one column of AB as A times that column of B
  • Use one matrix-vector product to check a full matrix product
  • Say which column of B supplies a given column of AB
Check yourself

A=[1021]A=\begin{bmatrix}1&0\\2&1\end{bmatrix} andB=[0311]B=\begin{bmatrix}0&3\\1&1\end{bmatrix}. Write down column 2 ofABAB without computing column 1.

Answer

Column 2 ofBB is(3,1)(3,1). Multiply:A(3,1)T=(3⋅1+1⋅0, 3⋅2+1⋅1)T=(3,7)TA(3,1)^T=(3\cdot1+1\cdot0,\ 3\cdot2+1\cdot1)^T=(3,7)^T.

So column 2 ofABAB is(3,7)(3,7). Column 1 is irrelevant to this column, which is the point: each column of the product is an independent computation.

Work out where to start — free, no accountAnswer six real questions — free, no account