1
$\begingroup$

For example, choose $p(X) = X^4 + X + 1$, how to construct addition and multiplication tables for $\mathbb{F}_{2}[X] \mod{X^4 + X + 1} $ ?

$\endgroup$
1
  • $\begingroup$ What have you tried? $\endgroup$ Nov 4, 2018 at 19:15

1 Answer 1

5
$\begingroup$
p = X^4 + X + 1;
mod[x_] := PolynomialMod[x, p, Modulus -> 2]
elements = mod[Plus @@@ Subsets[X^Range[0, 4]]]

And the tables are:

plustab = Outer[mod@*Plus, elements, elements];
timestab = Outer[mod@*Times, elements, elements];

If you prefer to identify the elements by their index in elements, you can do

lookuptable = AssociationThread[elements, Range[Length[elements]]];
plustabidx = Lookup[lookuptable, #] & /@ plustab;
timestabidx = Lookup[lookuptable, #] & /@ timestab;
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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