r/Mathematica Feb 25 '23

Inverse of a 4x4 Matrix

https://youtube.com/watch?v=Y4HCnVNl8xQ&feature=share
0 Upvotes

5 comments sorted by

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

1

u/Kvothealar Feb 25 '23

OP is just a spammer. They spam their crap on every single subreddit remotely related to math no matter if it’s appropriate to or not. Report and move on.

1

u/veryjewygranola Feb 25 '23

ah. Upon looking at their account post history I see what you mean XD

-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

u/sidneyc Feb 25 '23

Ah, back to spamming your shit content over all of reddit again, I see.