The identity matrix acts like the number 1 in matrix multiplication. Multiplying a matrix by (where the dimensions are compatible) leaves unchanged: and . This property is essential for understanding how to "undo" matrix multiplication, much like division or reciprocals undo multiplication with regular numbers.
Consider a simple algebraic equation like . To find , you would divide both sides by 5, or equivalently, multiply both sides by the reciprocal of 5, which is or . Multiplying by the reciprocal effectively isolates by turning the coefficient into .
Can we find a similar concept for matrices? If we have the matrix equation , can we find a matrix that acts like the "reciprocal" or "inverse" of ? If such a matrix exists, we could multiply both sides of the equation by it to potentially isolate the vector .
This brings us to the definition of the matrix inverse. For a square matrix (meaning it has the same number of rows and columns, say ), its inverse, denoted as , is another matrix such that when multiplied by (in either order), the result is the identity matrix .
Formally, if is an square matrix, its inverse is an matrix satisfying:
The idea of the matrix inverse gives us a way to solve the system . If is invertible, we can multiply both sides of the equation on the left by : Using the associative property of matrix multiplication: Since (the identity matrix): And because the identity matrix times any vector is just : This looks like a direct way to find the solution vector : just find the inverse of and multiply it by the vector .
While this is mathematically correct and provides a clear algebraic solution path, calculating the inverse explicitly just to compute is often not the most computationally efficient or numerically stable method for solving systems of equations in practice, especially for large matrices. Libraries like NumPy typically use more effective algorithms (which we'll see shortly). However, understanding the inverse is fundamental to grasping the properties of linear systems and matrix operations.
Before we jump into calculating inverses with NumPy, we need to understand when a matrix actually has an inverse. What makes a square matrix invertible or singular? That's what we'll cover next.
Was this section helpful?
numpy.linalg), NumPy Developers, 2024 - Official documentation for NumPy's linear algebra functions, important for computational use of matrix inverses and solving linear equations.© 2026 ApX Machine LearningAI Ethics & Transparency•