Category: Linear Algebra Level: 301
column j of AB = A (column j of B) = b1j a1 + b2j a2 + b3j a3
Each column of AB is a mix of the columns of A. The matching column of B says how much of each to use.
A has three columns, and each one is an arrow in the plane. Every column of the product is built from these three.
a1 = (1, 1), a2 = (0, 1), a3 = (2, -1)
Column 1 of B is (2, 1, 1). Take two of a₁, then one of a₂, then one of a₃, tip to tail. The trip ends at (4, 2), the first column of AB.
2a1 + 1a2 + 1a3 = (4, 2)
Column 2 of B is (1, 0, 2). Take one of a₁, skip a₂ since its weight is 0, then two of a₃. The trip ends at (5, −1).
1a1 + 0a2 + 2a3 = (5, -1)
The two landing points are the two columns of AB. Row times column gives the same numbers, one entry at a time.
AB = [[4, 5], [2, -1]]
cd svg-generator python3 -m svgmath render matrix-multiplication-columns --out /tmp/matrix-multiplication-columns
Source: svgmath/diagrams/matrix_ops.py