       Re: Inverting a non-square matrix

• To: mathgroup at smc.vnet.net
• Subject: [mg20239] Re: [mg20201] Inverting a non-square matrix
• From: "Andrzej Kozlowski" <andrzej at tuins.ac.jp>
• Date: Fri, 8 Oct 1999 18:30:16 -0400
• Sender: owner-wri-mathgroup at wolfram.com

```First there is no such thing as the "inverse" of a non-square matrix. Only a
square matrix can possibly have an inverse. A non-square matrix can have at
best have a left-inverse or a right inverse. (And in fact it can't have
both). Your matrix can have only a right inverse, i.e. a matrix 4x3 B such
that A.B=IdenittyMatrix. Here is a formula which presumably gives what
you wanted:

B = Transpose[A].MatrixPower[A.Transpose[A], -1]

However a word of warning. Mathematica will compute this for your matrix but
you will get an awful expression and applying Simplify will take for ages.
Even verifying that A.B=IdentityMatrix takes too long for my patience. So
here I will just show what happens in the case of a 2x3 matrix:
In:=
A = {{a, b, c}, {d, e, f}};
In:=
B = Transpose[A].MatrixPower[A.Transpose[A], -1] // Simplify
Out=
2    2
-b d e - c d f + a (e  + f )
{{--------------------------------------------------------------------------
,
2   2    2                                     2   2    2     2   2    2
c  (d  + e ) - 2 a c d f - 2 b e (a d + c f) + b  (d  + f ) + a  (e  + f )

2
b  d - a b e + c (c d - a f)

--------------------------------------------------------------------------},
2   2    2                                     2   2    2     2   2    2
c  (d  + e ) - 2 a c d f - 2 b e (a d + c f) + b  (d  + f ) + a  (e  + f
)

2    2
-e (a d + c f) + b (d  + f )

{--------------------------------------------------------------------------,
2   2    2                                     2   2    2     2   2    2
c  (d  + e ) - 2 a c d f - 2 b e (a d + c f) + b  (d  + f ) + a  (e  + f
)

2
-a b d + a  e + c (c e - b f)

--------------------------------------------------------------------------},
2   2    2                                     2   2    2     2   2    2
c  (d  + e ) - 2 a c d f - 2 b e (a d + c f) + b  (d  + f ) + a  (e  + f
)

2    2
c (d  + e ) - (a d + b e) f

{--------------------------------------------------------------------------,
2   2    2                                     2   2    2     2   2    2
c  (d  + e ) - 2 a c d f - 2 b e (a d + c f) + b  (d  + f ) + a  (e  + f
)

2
-a c d + a  f + b (-c e + b f)

--------------------------------------------------------------------------}}
2   2    2                                     2   2    2     2   2    2
c  (d  + e ) - 2 a c d f - 2 b e (a d + c f) + b  (d  + f ) + a  (e  + f
)
In:=
A.B // Simplify
Out=
{{1, 0}, {0, 1}}
--
Andrzej Kozlowski
Toyama International University
JAPAN
http://sigma.tuins.ac.jp
http://eri2.tuins.ac.jp

----------
>From: Nicolas Bardou <nicolas.bardou at at.siemens.fr>
To: mathgroup at smc.vnet.net
>To: mathgroup at smc.vnet.net
>Subject: [mg20239] [mg20201] Inverting a non-square matrix
>Date: Thu, Oct 7, 1999, 10:06
>

> Hi all,
>
> I learnt a bit of Mathematica when I was student and I need a formal
> calculation of the inverse of a non square matrix. But we do not have
> the software in my department.
> Can anyone say me if it is possible, and what are the formulas?
> My matrix is:
> A =
> [a b c d]
> [e f g h]
> [i j k l]
> and all the parameters are variable.
>