In more detail
A matrix with m rows and n columns is an m × n matrix. Matrices of the same size add entry by entry. To multiply A × B, the number of columns of A must equal the number of rows of B, and each entry of the result is a row of A combined with a column of B (the dot product of a row and a column). The determinant of a 2×2 matrix with rows (a, b) and (c, d) is ad − bc: for rows (1, 2) and (3, 4) it is −2, and a determinant of zero means the matrix has no inverse.
Why it matters
Systems of linear equations, 2D and 3D graphics transforms, statistics and machine learning all run on matrix arithmetic. The surprise for most people is that order matters: A × B is usually different from B × A. A system whose matrix has a zero determinant has either no solution or infinitely many, never exactly one.
Example
A = | 1 2 | B = | 0 1 |
| 3 4 | | 1 0 |
A × B = | 2 1 | B × A = | 3 4 |
| 4 3 | | 1 2 |
A⁻¹ = (1 / −2) × | 4 −2 | = | −2 1 |
| −3 1 | | 1.5 −0.5 |
Solving x + 2y = 5 and 3x + 4y = 6 means computing A⁻¹ × (5, 6), which gives x = −4, y = 4.5. Check: −4 + 9 = 5 and −12 + 18 = 6.