Matrix inverse didn't flip the matrix when doing dot product

In the video Matrix inverse, we are trying to get the inverse matrix

So the operation is the original vector multiply [[3,1],[1,2]] then multiply[[a,b],[c,d]] and got the identity matrix.

Since we are looking for second matrix, so the system of equation should be
[[a,b],[c,d]] * [[3,1],[1,2]], why in here we didn’t flip the order?

Isn’t matrix multiplication non-commutative? like matrix A * matrix B != B * A

Hi @Bio_J,

Matrix multiplication is not commutative; however, when finding the inverse of a matrix, the order matters as it involves multiplying the original matrix by another matrix to achieve the identity matrix. We have left inverse and right inverse and they are not always the same for a given matrix.

The transmutation law does not apply in matrix operations.

Could you please explain what you mean by this?

Note that’s only for the case where the matrices are not square. In that case, they have to be different because the dimensions don’t even work in the other order. :scream_cat: Those are usually called “pseudo-inverses”. When mathematicians say matrix inverses, they only mean for square matrices.

In the case of square matrices, the left and right inverses are the same. Here’s a proof:

Suppose A and B are square matrices and A \cdot B = I.

B \cdot (A \cdot B) = B \cdot I = B

Matrix multiply is associative, so we have:

(B \cdot A) \cdot B = B

We know that det(A \cdot B) = det(A) * det(B) = 1, so det(B) \neq 0 and thus B is non-singular and invertible.

((B \cdot A) \cdot B) \cdot B^{-1} = B \cdot B^{-1} = I

(B \cdot A) \cdot (B \cdot B^{-1})= I

B \cdot A = I

So B = A^{-1} and we’ve shown that:

A \cdot B = B \cdot A = I

Of course it is true that matrix multiplication is not commutative in general, but that doesn’t mean that there aren’t special cases in which it can be. :nerd_face:

Reference: wikipedia.

2 Likes

Thanks for your information! I was trying to keep it simple, and it looks like I forgot to mention some crucial points :sweat_smile: