Think of multiplictavie group of finite field F[p,n], where p is a prime number and n is a positive integer. The whole elements of F[p,n] can be represented as
p^n-p^(n-1) positive integers in the following list :


One can define addition,subtraction,multiplication easily :
Mod[a+b,p^n],Mod[a-b,p^n],Mod[a*b,p^n]. (addition and subtraction are not closed.. if they are divisible by p)

For Inverse a^-1 and division a/b, currently I am using

For example 7/3 (mod 11) is 6, since 7 = 3*6 (mod 11)

In[1] Mod[7*ExtendedGCD[3,11][[2,1]],11]
Out[1] 6

What do you use for inverse or division ?

  • 1
    $\begingroup$ Hmm...I don't think what you have is a finite field. A finite field is something that's an abelian group under addition whose nonzero elements form an abelian group under multiplication. But for example, $p$ here doesn't have a multiplicative inverse, yet it would necessarily be part of your finite field (as it can be written as an addition of elements you have, $1 + (p - 1)$). I think what you have is the ring $\mathbb{Z}/p^n\mathbb{Z}$, which for $n > 1$ is not a field. $\endgroup$
    – thorimur
    Sep 20 at 23:56
  • 3
    $\begingroup$ Mod[7 * ModularInverse[3, 11], 11] $\endgroup$ Sep 20 at 23:58
  • $\begingroup$ I think you'd be interested in the Finite Fields Package which is included with Mathematica; the finite field $\mathbb{F}_{p^n}$ can be obtained via GF[p, n]. $\endgroup$
    – thorimur
    Sep 21 at 0:00
  • $\begingroup$ (Also, I should have made it clear: fields must be closed under addition, as they must be an abelian group under addition. If it's not, it's not a field. but might still be interesting! :) ) $\endgroup$
    – thorimur
    Sep 21 at 0:05
  • $\begingroup$ Thank you, what I wantd is ModularInverse, and apologize for my math knowledge! $\endgroup$
    – imida k
    Sep 22 at 2:36

Your Answer

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

Browse other questions tagged or ask your own question.