AI & ML — LAB
Matrix Operations Lab
Pick an operation, set the matrix size, fill in any numbers you want, and see the result computed live. Multiplication is the operation covered in Matrix Multiplication, alongside the other core matrix operations from the same grade 12 chapter — addition, subtraction, scalar multiplication, transpose, determinant, and inverse.
How to Use This Lab
- Pick an operation from the buttons above the matrices — the inputs and result update to match.
- Use the +/− controls to change matrix size where the operation allows it (multiplication enforces A’s columns = B’s rows; addition/subtraction keep A and B the same size; determinant/inverse are limited to square 2×2 or 3×3).
- Type any numbers you want directly into each matrix’s cells.
- For multiplication, click “Compute next cell” to fill in the result one cell at a time and see exactly which row and column combine to produce it.
The Lab
What Each Operation Means
Multiplication (A × B)
Each output cell is a row of A dotted with a column of B — only defined when A’s column count matches B’s row count.
Addition & Subtraction
Add or subtract matching cells directly — only defined between two matrices of the exact same size.
Scalar Multiplication
Multiply every single cell in A by the same number k — the simplest matrix operation there is.
Transpose (Aᵀ)
Turn every row of A into a column, in the same order — a 2×3 matrix’s transpose is 3×2.
Determinant (det(A))
A single number computed from a square matrix that, among other things, tells you whether the matrix has an inverse at all — zero means it doesn’t.
Inverse (A⁻¹)
The matrix that “undoes” A, computed here as A⁻¹ = adj(A) / det(A) — only exists when det(A) is not zero.
Want the full explanation of matrix multiplication — why it’s the exact operation a neural network layer computes, and why GPUs are built specifically to run it fast? Read Matrix Multiplication →