The interactive film is in the book's Companion

Play it, pause it, turn it and drag it with Mathematics for AI and Machine Learning.

Get the book

Four Views of Matrix Multiplication

Chapter 2 · Mathematics for AI and Machine Learning · Advanced · 2:29

An interactive live film: A and B stand on two walls of a 3D box whose cells hold the products a_mi b_in; summing a vertical line, an upright slice or a flat layer gives the dot-product, column, row and outer-product views of AB. Pick any entry, view and layer.

Narration

Here is A, with three rows and four columns, standing on the left wall, and B, with four rows and two columns, on the back wall. Their product C sits on the lid, on top.

Every cell of this box holds one product: the entry of A and the entry of B that face it on the two walls. Rows of A run along one direction, columns of B along another, and the inner index runs downward.

The rest of the narration is in the book's Companion.

More from Chapter 2

Interactive1:40Change of Basis: One Vector, Two Sets of CoordinatesChapter 2Preview1:29The Matrix Inverse: Squashed Means GoneChapter 2Preview1:53A Matrix Moves the CubeChapter 2Preview1:49Rank One as a LandscapeChapter 2Preview1:44Column Space: Every Output Ax Lies on One PlaneChapter 2Preview1:37The Projection Matrix: Outer times Inverse InnerChapter 2Preview1:36Matrix Norm and Condition Number: the Largest StretchChapter 2