Use symbolic linear algebraLesson 33 of 48 · 8 min
Check an inverse by multiplication
Use a determinant and an exact product to establish invertibility in a small example.
Maths refresher: The identity transformation
The identity matrix leaves every compatible vector unchanged. An inverse undoes another matrix’s action.
Multiplying a vector by and then by restores that vector when the inverse exists. A zero determinant rules this out.
A square matrix is invertible when its transformation can be undone uniquely. The determinant is a number calculated from the matrix. If it is zero, the matrix is singular and has no inverse. A singular matrix sends some distinct inputs to the same output, so that output cannot tell them apart.
- Illustrative vector
- Apply A
- Apply its inverse
The code checks the determinant before calling A.inv() to find the inverse. Multiplying the inverse by the original matrix gives the identity matrix, which leaves every vector unchanged.
These are small exact matrices. Large numerical systems usually use a solver that factors the matrix and avoids computing the inverse explicitly.
Can a matrix with dependent rows have a two-sided inverse?
Write a prediction (optional)
Exact symbolic investigation
Select Run Python with the code unchanged.
Your saved draft is open. To use the published code, select Restore example in Tools. Use Recover draft to bring back your code.
Tools
About Python
Python and the course packages can load while you read. Each run starts with fresh user variables; imported modules stay loaded. Stop replaces the worker. Runtime details ↗
Ctrl+Enter or ⌘+Enter runs Python.
Execution error
Technical error details
Your result
Python text output
Compare with the worked example
Executed from the published Python during the site build. Your own run appears above. Build environment ↗
Worked text output
Determinant of A: 1 Inverse: Matrix([[1, -1], [-1, 2]]) Inverse check: Matrix([[1, 0], [0, 1]])
Read the starter result
Find Determinant of A and Inverse check. The determinant is 1. The product in Inverse check has ones on the diagonal and zeroes elsewhere.
Edit and compare
Replace the bottom-right 1 in A with sp.Rational(1,2) for exactly one half. Select Run Python. What do Determinant of A and Inverse report for the edited matrix?
Scope. Numerically tiny determinants alone are poor conditioning diagnostics; floating-point problems need scale-aware analysis.
Try a fresh case
What does a nonzero determinant establish for a square exact matrix?
Need a hint?
Hint 1
Connect determinant zero with collapsed directions.
Hint 2
A reversible square transformation has no lost direction.