Matrix multiplication and what it represents
A matrix records a linear rule. Multiplying matrices composes the rules, which is why the product is defined by rows against columns and why order matters.
What a learner can do afterwards
- Multiply two matrices and state when the product is defined
- Give two matrices whose products in the two orders differ
- Read a matrix-vector product as a combination of the columns
1 · Read
A matrix is a linear rule that turns inputs into outputs. A shape m by n means m rows and n columns. AB applies B first, then A. Reversing the order can change the rule. AB exists when A's number of columns equals B's number of rows. For 2 by 5 times 5 by 3, the inner sizes agree and the product is 2 by 3. The identity matrix I has 1s on its diagonal and 0s elsewhere. With matching sizes, AI = A and IA = A: I leaves inputs unchanged.
In AB, B acts on the input before A does.
Take A with rows (1, 2) and (3, 4), and B with rows (5, 6) and (7, 8). The top left entry of AB pairs row 1 of A with column 1 of B: 1(5) + 2(7) = 19.
Order matters. A 4 by 2 times a 2 by 3 works, but the reverse does not exist. When both orders exist, the values can still differ. With A rows (1, 1), (0, 1) and B rows (1, 0), (1, 1), the top left entry of AB is 1(1) + 1(1) = 2, but in BA it is 1(1) + 0(0) = 1.
Read a matrix-vector product Av as a combination of the columns of A. Each entry of v scales one column, and the scaled columns are added entry by entry, as in 3(1, 2) + (4, 1) = (7, 7). So v needs one entry per column of A.
To test whether A times B exists, use the rightmost dimension of A and the leftmost dimension of B. For a 4 by 3 matrix A, a right factor must have 3 rows. A 3 by 2 factor works and produces a 4 by 2 product. A 4 by 3 factor does not work.
Use A with rows (2, 0) and (1, 3), and B with rows (4, 1) and (5, 2). The bottom right entry of AB uses row 2 of A, (1, 3), and column 2 of B, (1, 2): 1 times 1 plus 3 times 2 equals 7.
Check shapes first, pair rows with columns, keep the order, and read Av as weighted columns.
Original lesson and assessment text by the Open Source Taxonomy project.
Includes adapted readings credited to the academy collections, a Khan Academy video and original practice questions. The rewritten reading was written for this dataset. Individual source titles are listed with the resources. The source licenses are unknown.
2 · Watch
En anglaisTake it off screen
Where it sits
14 questions wait behind this lesson, each with its answer explained. Every answer feeds the sky: stars light as they are learned, and dim when it is time to come back.