Methods for obtaining inverses of matrices $\mod p$ and comparisons to methods for inverses of regular matrices

53 Views Asked by At

I have read through many of the methods on Wikipedia listed under (https://en.m.wikipedia.org/wiki/Invertible_matrix) for obtaining inverses of regular matrices.

I would like to know which if any of these methods can be used to calculate an inverse of a matrix $\mod p$?

If any of the methods stated can be used, please advise why & provide an example. Similarly if none of the methods can be used.

1

There are 1 best solutions below

0
On

For $2 \times 2$ matrices we can apply Cramer's rule; the inverse of

$$\begin{bmatrix} a & b \\ c & d \end{bmatrix}$$

is $$\frac{1}{\det(A)}\begin{bmatrix}d & -b\\-c &a\end{bmatrix}$$ where

$\det(A) = ad -bc \neq 0$. This works modulo any prime, or even modulo $n$ if $\gcd(\det(A), n) = 1$.

For higher order I'd use Gaussian elimination, like I showed here being done modulo $11$.

In that case we start with

$$ \left[ \begin{array}{ccc|ccc} a & b & c & 1 & 0 & 0\\ d & e & f & 0 & 1 & 0\\ g & h & i & 0 & 0 & 1 \end{array} \right] $$

and keep multiplying and substracting equations till we have the identity matrix on the left and $A^{-1}$ on the right.

Or use a decent mathematical computer package, or wolframalpha online.