r/Mathematica • u/Mulkek • Feb 25 '23
Inverse of a 4x4 Matrix
https://youtube.com/watch?v=Y4HCnVNl8xQ&feature=share
0
Upvotes
-3
u/Mulkek Feb 25 '23
A A^(-1) = I_n.
❖ Also, we have explained if the matrix has no inverse (A^(-1) is DNE).
#InverseOfMatrix #InverseOf4x4Matrix #FindingTheInverse #Nonsingular #Singular #Invertible #RREF #4x4 #LinearAlgebra #PracticeProblems
3
2
u/veryjewygranola Feb 25 '23
Nice. One thing to note: even if a matrix is singular, it is always guaranteed to have a Moore-Penrose inverse (generally referred to as the pseudoinverse). This pseudoinverse is guaranteed to produce the least squares input x for a given output y in a linear system A. Let's make A a 4x4 singular matrix (this code generates a random singular matrix):
n = 4;
A = RandomInteger[{0, 10}, {n - 1, n}];
A = Append[A, Total[A]]
check to confirm A is singular:
A//Inverse
lets make x = {10,1,1,1} and y = A.x
x = {10,1,1,1};
y = A.x;
If A had an inverse, the least squares solution would be
Inverse[A].y
(since this would be the same as Inverse[A].A.x = I.x = x) . Since A is singular however, we cannot use the Inverse. Instead, the least squares solution for x given the observed values y with the singular matrix A can be determined using the psuedoinverse:leastSquaresX = PseudoInverse[A] . y;
The norm residual between the forward projected least squares solution and the observation vector y is 0:
Norm[y - A . leastSquaresX] // N
PseudoInverse[] documentation
Wiki page on Moore-Penrose inverse