AI Grounds
Open AI Grounds on a desktop
These interactive lessons need a larger screen. Please continue on a desktop or laptop computer.
AI Grounds
These interactive lessons need a larger screen. Please continue on a desktop or laptop computer.
Guided discovery
Select a cell. Follow its row and column. Add the products.
(2 × 3) × (3 × 2) → (2 x 2)
Inner sizes match: 3 terms per output cell. Shape means rows × columns.
| k = 1 | k = 2 | k = 3 | |
|---|---|---|---|
| i = 1 | 2 | -1 | 3 |
| i = 2 | 0 | 4 | 1 |
Row 1 of A
| j = 1 | j = 2 | |
|---|---|---|
| k = 1 | 1 | 5 |
| k = 2 | 2 | -2 |
| k = 3 | 0 | 3 |
Column 2 of B
| j = 1 | j = 2 | |
|---|---|---|
| i = 1 | ||
| i = 2 |
Selected: C[1,2]
Tab to an output cell; Enter or Space to select.
A dot product multiplies matching pairs, then adds their products.
2 x 5 = 10
Pair 1Reveal pair 2
Pair 2Reveal pair 3
Pair 3Running sum: 10 → …
k pairs each position in the row with the same position in the column.
C[1,2] uses row 1 and column 2. Step 1 of 3; running sum 10.
A’s rows × B’s columns.
2 x 2
(2 x 3) × (3 x 2) → (2 x 2)
The shared inner size.
3
3 A columns = 3 B rows
Row 1 · Column 2.
21
C[1,2] = 21
4 output cells means 4 row-column dot products.
Incompatible example: (2 x 3) × (2 x 2)
Blocked: inner sizes 3 and 2 differ.
Dimension rule
(m × n) × (n × p) → (m × p)
C[i,j] = Σ A[i,k] × B[k,j], for k = 1 to n. Σ means add all the products. i chooses a row, j a column, and n is the shared size.