What these operations mean
A matrix is just a rectangular grid of numbers that you agree to treat as one object. Once you do that, you can add two of them, multiply them, or ask questions about a single one — and those questions turn out to describe things like rotations, systems of equations and how a network passes influence around.
- Addition and subtraction happen cell by cell, so both matrices must be the same size.
- Multiplication is not cell by cell. Each entry of the result is a dot product of a row from the first matrix with a column from the second — which is why A × B and B × A usually give different answers. Try it with the default values and see.
- The determinant is a single number that tells you whether a matrix can be inverted. If it is zero, the matrix squashes space flat in at least one direction, and no inverse exists.
- The inverse is the matrix that undoes the original: A × A⁻¹ gives the identity matrix, the one with 1s down the diagonal and 0s everywhere else.
If the determinant is zero, the inverse does not exist — the calculator will say so rather than show you meaningless numbers.
Where you will actually meet this
The 4×4 grid in 2048 is a matrix, though the game only ever slides and merges it rather than doing arithmetic on it. Computer graphics uses 3×3 and 4×4 matrices to rotate and scale everything you see on screen. Solving several equations at once is usually done by inverting a matrix. And the thing that ranks pages or recommends videos is, at bottom, a lot of matrix multiplication.
See the idea in motion
Sliding tiles around a grid is the most hands-on way to get a feel for how a matrix transforms.
Play 2048 →