0

When calculating with numbers from a $\mathbb{Z}/2\mathbb{Z}$ how do you deal with unknown variables? For example, if I have the following term:

$(a - 1)(a - 1) - (a - 1) - (a - 1) = a^2 + 1$

Or is this incorrect?

Max
  • 255
  • Are you familiarized with rings of polynomials? In your case, $\mathbb{Z}/2\mathbb{Z}[X]$. – Alejandro Bergasa Alonso Jan 23 '21 at 23:11
  • Not really, I am just starting to familiarise myself with these topics. – Max Jan 23 '21 at 23:13
  • Are you trying to solve for a? Or are you trying to simplify the polynomial? Are you looking for a general method or just this one example? – open problem Jan 23 '21 at 23:15
  • @Max Look at the answer I wrote. I'm not sure if that's exactly what you were asking for, but I hope it helps you to understand a bit more about this topic. Ask me if there's anything you don't get clear from my answer. – Alejandro Bergasa Alonso Jan 23 '21 at 23:17
  • Thanks, both answers are what I was looking for! I am really just trying to wrap my head how to deal with something like $2a$ in this context. – Max Jan 23 '21 at 23:21

3 Answers3

2

$\mathbb{Z}/2\mathbb{Z}$ is a ring with characteristic $2$, so that means that, for any $x\in\mathbb{Z}/2\mathbb{Z}n$, then $x+x=0$. From this, we know directly that the part $-(a-1)-(a-1)=0$, so we're left with

$$(a-1)(a-1),$$ and calculating it normally we get that $$(a-1)(a-1)=a^2-2a+1,$$ but $2 \equiv 0$ in $\mathbb{Z}/2\mathbb{Z}$, so we conclude that $$(a - 1)(a - 1) - (a - 1) - (a - 1) = a^2 + 1$$ and you were right.

J. W. Tanner
  • 60,406
1

$\newcommand{\Z}{\mathbb{Z}}$First note that \begin{align*} (a-1)(a-1) - (a-1) - (a-1) &= a^2 + 1 - a + 1 - a + 1\\ &= a^2 - 2a + 3 \end{align*} At least under more normal circumstances. In $\Z/2\Z$, though, $2x=0$ for every $x \in \Z / 2 \Z$. This does, in fact, include variables. (After all, the variables are eventually elements from $\Z / 2 \Z$, we just don't know which ones.) Thus,

$$-2a = -(2a) = 0 \qquad 3 = 2 + 1 = 0 + 1 = 1$$

(This might be easier to grasp if you recall that $\Z/2\Z$ is, in reality, sets of equivalence classes rather than strictly numbers: that is, the statement $3=1$ means, rather, "$3$ and $1$ share the same equivalence class in $\Z/2\Z$.")

And thus,

$$(a-1)(a-1) - (a-1) - (a-1) = a^2 + 1$$

as you would expect.

PrincessEev
  • 43,815
  • A word of warning. When disucssing the polynomial ring $\Bbb{Z}/2\Bbb{Z}[x]$ you cannot treat $x$ as a unknown element of $\Bbb{Z}/2\Bbb{Z}$. The standard example is the quadratic polynomial $p(x)=x^2+x\in\Bbb{Z}/2\Bbb{Z}[x]$. We have $p(a)=0$ for all $a\in\Bbb{Z}/2\Bbb{Z}$, but $p(x)$ is not the zero polynomial (it is a quadratic after all). See here. – Jyrki Lahtonen Jan 24 '21 at 06:48
  • Undoubtedly you knew about the above. If it is known that $a$ is an element of $\Bbb{Z}/2\Bbb{Z}$ then we can do more (see Zwim's answer). I just wanted to warn the unaware reader about this. – Jyrki Lahtonen Jan 24 '21 at 06:54
0

Notice that $a^2\equiv a$ in $\mathbb Z/2\mathbb Z\quad$ (since $0^2=0$ and $1^2=1$).

So you can also simplify this way

$\require{cancel}\underbrace{(a-1)(a-1)}_{=(a-1)}-(a-1)-(a-1)\equiv \cancel{(a-1)}-\cancel{(a-1)}-(a-1)\equiv 1-a\pmod 2$

Since $2a\equiv 0$ you also have $1-a\equiv 1-a+2a\equiv 1+a\pmod 2$

Which is the same as $\quad 1+a^2\equiv 1+a\pmod 2\quad$ by the way.

We can go further and write this $\tilde a$ since $1+a$ will just invert the parity of $a$.

zwim
  • 28,563
  • Thanks for your answer, I have a question about this. In the following case: $(a-1)(a-1)a$, I see two different options: $\cancel{(a-1)}\cancel{(a-1)}a \equiv a$ or $(a^2 - a)(a -1) \equiv \cancel{(a - a)}(a - 1) \equiv a - 1$. But clearly $a \not\equiv a - 1$, or am I mistaken? – Max Jan 24 '21 at 10:51
  • Both are wrong, lol. $(a-1)^2a=(a-1)a=a^2-a=a-a=0$ and $(a^2-a)(a-1)=(a-a)(a-1)=0(a-1)=0$ Zero should not be surprising, either $a$ or $(a-1)$ is even, so their product is even, i.e. $0$ modulo $2$. – zwim Jan 24 '21 at 11:30
  • Aaaaah I see. Thank you, I'm still working on understanding it properly. – Max Jan 24 '21 at 12:05