I stumbled into this question in the course of some experiment:
I had this system of linear equations:
m = 1a+2b+3c+4d
n = 2a+3b+4c+1d
o = 3a+4b+1c+2d
p = 4a+1b+2c+3d
I have no fixed values for m, n, o, p as my a, b, c, d are vectors, so m, n, o and p are output vectors.
So I calculated the following general case solution:
a2 = (-211m+152n-3o-22p)/-76
b2 = (10o+116m+p-76n)/18
c2 = (-17o+20n+3m+2p)/76
d2 = (7m-7n+o+p)/38
I wanted to check my results by comparing the vectors a and a2, b and b2 and so on, but I can't find the good values.
So I used an inverse matrix solver to solve the system, which gave me
a4=(-0,225*m)+(0,025*n)+(0,025*o)+(0,275*p)
b4=(0,025*m)+(0,025*n)+(0,275*o)+(-0,225*p)
c4=(0,025*m)+(0,275*n)+(-0,225*o)+(0,025*p)
d4=(0,275*m)+(-0,225*n)+(0,025*o)+(0,025*p)
These vectors, besides floating point mistakes, are found to be equal to originals.
My questions is:
How could I have reached this inverse matrix by using linear equations?
I am puzzled because I did this for a 3*3 system and it worked, as demonstrated below, still for a 4*4 system, it is a mess and it doesn't work, for some reason.
Can someone explain this to me?
Thanks
m = (1*a) + (2*b) + (3*c)
n = (2*a) + (3*b) + (1*c)
o = (3*a) + (1*b) + (2*c)
a4=((-5*m)+(1*n)+(7*o))/18
b4=((1*m)+(7*n)+(-5*o))/18
c4=((-7*m)+(5*n)+(-1*o))/-18
These coefficients match the inverse matrix.
-0.277777778 0.055555556 0.388888889
0.055555556 0.388888889 -0.277777778
-0.388888889 0.277777778 -0.055555556