Matrix Inverse

The inverse of a Matrix Transformation is a matrix that reverses the transformation.
For example, if our matrix transform did a 90° anticlockwise rotation, the inverse matrix would do a 90° clockwise rotation.
We represent the inverse of a matrix A as A−1.
When you multiply a matrix by its inverse, you get the Identity Matrix back: A⋅A−1=I
It's the equivalent of the reciprocal of a number in scalar math, ie 10∗110=1 or 10⋅10−1=1
For a 2×2 matrix, we calculate the inverse as follows:
[abcd]−1=1ad−bc[d−b−ca]
For example:
[1324]−1=11×4−3×2[4−3−21]=−12[4−3−21]=[−21.51−0.5]
We can do a matrix multiplication to confirm the identity matrix is returned:
[1324][−21.51−0.5]=[1001]
We can also use the np.linalg.inv
method in Numpy to find the inverse.
import numpy as np
m = np.array([[1, 3], [2, 4]])
m_inv = np.linalg.inv(m); m_inv
array([[-2. , 1.5], [ 1. , -0.5]])
m @ m_inv
array([[1., 0.], [0., 1.]])
The ad−bc part of the expression is the Matrix Determinate.
For a larger matrix, we can use Gaussian Elimination to invert a matrix.
[@dyeMathematicsMachineLearning]
A matrix with a determinate of 0: ∣A∣=0 is referred to as a Singular Matrix and has no inverse.
We can only calculate the inverse of a square matrix.
[@khanacademylabIntroMatrixInverses]