How can I to define a constant in $Z_{2}$?

For example, I want to create a constant b that inherits the properties of an element from $Z_{2}$. For example

b + b = 0
b^n = b

1 Answer 1


Your question focuses on the wrong aspect of finite fields. It's not the numbers 0 and 1 that change because you are working with $Z_2$, it's the arithmetic operators. You could define your own operators plusZ2 and TimesZ2.

An alternative is to load the finite fields package with Needs[FiniteFields`], which overloads the relevant arithmetic operators for you.

  • $\begingroup$ Great! You are right! Thanks. But... I have some large polynomials whose coefficients are in $Z_{2}$... for example: $p(X)=(a+b^2+c^4+5b^6....)X+(.....)X^2+....$ So, how can I simplify $(a+b^2+c^4+5b^6....)$ in a authomatic way? (suppose $(a+b^2+c^4+5b^6...)$ is in arithmetic of $Z_2$) $\endgroup$
    – Imu
    May 22, 2014 at 20:53
  • $\begingroup$ @user14545. Advise you to follow the link I provided. $\endgroup$
    – m_goldberg
    May 22, 2014 at 20:59
  • $\begingroup$ @user14545. Previous comment is not a brush-off. I simply don't have the experience to help you with the new question you pose in your comment. Try to use the finite fields package. If have trouble solving your problem with it, come back with a new question, which is specific to applying the package to your polynomials. $\endgroup$
    – m_goldberg
    May 22, 2014 at 21:08
  • $\begingroup$ Thanks again. I saw the package that you recommend, but I had some problems. So... I ask again: I load: Needs["FiniteFields`"]; fld = GF[2] And, I want to do: a^3+a^2 I write: fld[{a^3}] + fld[{a^2}] but mathematica give me: Subscript[{Mod[a^2 + a^3, 2]}, 2] And I'd like mathematica give me: 0 $\endgroup$
    – Imu
    May 22, 2014 at 21:14
  • $\begingroup$ @user14545. Please do not ask new questions in a comment. This is not a discussion forum. Bring what you ask above to the attention of the community by writing it up as a new question. $\endgroup$
    – m_goldberg
    May 22, 2014 at 21:20

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.