tags:

views:

305

answers:

5

let's say we have the following matrix multiplication:

A = B * C

where A,B,C are square (NxN) matrices.

how can i get B from the above statement?

is it:

B = C^-1 * A

or

B = A * C^-1

or something else???

(where C^-1 is the inverse matrix.)

thanks!

+3  A: 

I'm a little rusty on my algebra, but just looking at it:

A = B * C

A * C(inv) = B * C * C(inv)

A * C(inv) = B

B = A * C(inv)

Larry Watanabe
+1  A: 

Close, Larry, but remember that matrix multiplication is NOT associative.

A = B * C

A* C(right C-inverse) = B * C * C(right inverse)

A * C(right inverse) = B

B = A * C(right inverse)

Stefan Kendall
just want to add, that all matrices are NxN matrices, so there shouldnt be a right or left inverse, afaik? but i might be wrong
clamp
I think that the standard inverse is the right inverse, no? In our algebra classes we never used left inverse.
Larry Watanabe
The inverse of a square matrix , sometimes called a reciprocal matrix, is a matrix such that (1) where is the identity matrix. Courant and Hilbert (1989, p. 10) use the notation to denote the inverse matrix.
Larry Watanabe
see link http://mathworld.wolfram.com/MatrixInverse.htmlThere is no need to say "right inverse" - the definition of an inverse matrix is that it is such that A * A(inv) = I
Larry Watanabe
@matt, AxB may or may not be equal with BxA matrix, that's a fundamental property of matrices multiplication.
Nick D
yes i know, that's why i was asking my question. ;)
clamp
@iftrue, matrix multiplication IS associative: A(BC)=(AB)C. It isn't commutative: AB is in general different from BA.
sdcvvc
+1  A: 

You're advised not to calculate the inverse of C using Gauss' method.

You'd use LU decomposition to reduce C to lower and upper triangular form, then forward-back substitution to calculate the solution.

We're assuming, of course, that C has an inverse. It may not. If C is square, it can't have a zero determinant.

If the number of columns exceeds the number of rows, multiply both sides by C(transpose) to get a square matrix and and solve that to get a least squares solution.

If the number of rows exceeds the number of columns, use Singular Value Decomposition instead of LU to get the best solution you can. It'll tell you the size of C's null space.

duffymo
i am not asking how to calculate the inverse. and yes, all matrices are square.
clamp
Funny coming from a guy who was trying to solve for B by inverting A instead of C. You would have gotten closer if you'd forgotten for a second that A, B, and C were matricies. If they were simply real numbers, how would you solve for B if A = B*C? (Hint: Still the inverse of C., not A.) And you gave no indication of the type of matrix, so I thought I'd offer all three cases.
duffymo
well, if they were real numbers, there would be no difference between B = C * A^-1 and B = A^-1 * C. but matrix multiplication is not commutative afaik, that's why i was asking my question.
clamp
You are quite missing my point: Why do you keep insisting that A is the one that needs to be inverted? Your equation is A=B*C; it's not A that needs to be inverted. Even when it's explained you persist in this error.
duffymo
ah yes, i am sorry. i made a big mistake in my original question. i meant of course C^-1 instead of A^-1.sorry. i will edit my question accodringly
clamp
A: 
B = A * C^-1

However, C^-1 does not necessarily exist. It might be considered overkill, but please investigate Singular Value Decomposition (SVD) for a safe way to find a matrix (pseudo)inverse.

Dave Gamble
A: 

Here is a link with source code on solving matrix equations and matrix inversion using LU decomposition.

Trent F Guidry