To multiply by , the number of columns of must equal the number of rows of . Each entry of is one row of times one column of : multiply matching entries and add.
| Step | On | |
|---|---|---|
| 1 | Write both sizes and compare the inner numbers. Columns of must equal rows of . If they differ, the product does not exist. | : inner ✓ |
| 2 | Read off the size of the product. The outer numbers: rows of by columns of . | is |
| 3 | Compute row 1: row 1 of A times each column of B. Multiply matching entries and add. | , |
| 4 | Repeat for every other row. An product has entries, each one row times one column. | , |
| 5 | Assemble the matrix and keep the order. and are usually different (non-commutativity). | , while |