Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
share|improve this question
up vote 2 down vote accepted

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.

share|improve this answer
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$) – user14545 May 22 '14 at 20:53
@user14545. Advise you to follow the link I provided. – m_goldberg May 22 '14 at 20:59
@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. – m_goldberg May 22 '14 at 21:08
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 – user14545 May 22 '14 at 21:14
@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. – m_goldberg May 22 '14 at 21:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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