1
$\begingroup$

So I know the definition of the Inverse of a Matrix A is that there exists matrix B such that AB=BA=I3, where I3 is the identity matrix. If A is invertible, then the matrix B is called the inverse of the matrix A, and it is denoted by A-1.

I'm trying to find the inverse of a random 3x3 matrix A with integer coefficient (if it exists) without using the Inverse[...] function in Mathematica. So far I have:

A=Table[RandomInteger[],{i,3},{j,3}]
B=Table[x[i,j],{i,3},{j,3}]

And would have to solve for B, such that

A.B==B.A==I

I have no idea how to start and anything would be helpful.

$\endgroup$
  • 5
    $\begingroup$ "without using the Inverse[...] function" and "I have no idea how to start" I think that these comments demonstrate that this is not a Mathematica question ... It is a linear algebra one. Before you can do this in Mathematica, you must become familiar with the underlying mathematics. $\endgroup$ – Szabolcs Mar 31 '17 at 19:05
  • $\begingroup$ I understand the actually Mathematics, but don't know how to start to code it for a random 3x3 matrix without finding the determinant, matrix of cofactors and then transposing. $\endgroup$ – HattieS Mar 31 '17 at 19:12
  • 1
    $\begingroup$ If you are trying to implement a specific algorithm, describe that algorithm in the question. $\endgroup$ – Szabolcs Mar 31 '17 at 19:13
  • $\begingroup$ I don't know if I meant to implement an algorithm as all I am given is that if A.B=B.A=I then B is said to be the inverse of A. $\endgroup$ – HattieS Mar 31 '17 at 19:18
  • 1
    $\begingroup$ Can you do it for two by two matrices first? $\endgroup$ – bill s Mar 31 '17 at 19:29
2
$\begingroup$
MatrixForm[First[B /. Solve[A.B == IdentityMatrix[Length[A]]]]]
$\endgroup$
2
$\begingroup$
LinearSolve[A, IdentityMatrix[Dimensions[A]]]
$\endgroup$
  • 1
    $\begingroup$ Technically, LinearSolve is not Inverse. But is it really any different? $\endgroup$ – Szabolcs Mar 31 '17 at 21:14

Not the answer you're looking for? Browse other questions tagged or ask your own question.