0
$\begingroup$

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.

$\endgroup$
2
  • 3
    $\begingroup$ In any field Gaussian elimimination works, and Cramer's rule too (but that's quite inefficient). I think series and approximations will not work over a finite field (which has the discrete topology), Elimination is the way to go. Division becomes multiplication with the modular inverse but the procedure is totally the same as over any other field. $\endgroup$ Sep 4 '17 at 21:03
  • $\begingroup$ Ok thanks. Is there a list / site somewhere that details most / common methods for obtaining inverse matrices $\mod p$? $\endgroup$ Sep 5 '17 at 6:23
1
$\begingroup$

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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