0
$\begingroup$

I have an equation such as

(a + b) mod n which is nothing but (a mod n + b mod n) mod n according to this.

Now, I know that b mod n is 0 which results in (a mod n) mod n.

Is this equivalent to a mod n itself? If so, is there any way to prove it?

$\endgroup$
  • $\begingroup$ So you want to prove $(a+0)\pmod n=a\pmod n?$ $\endgroup$ – awllower Jun 28 '16 at 10:01
  • $\begingroup$ You can see that $(a \bmod{n})\bmod{n}$ must be equivalent to $a\bmod{n}$. This is obvious because $a \bmod{n} \in [0,n-1]$ and so the second $\operatorname{mod}$ cannot have an effect. I hope this helps? $\endgroup$ – Thomas Russell Jun 28 '16 at 10:02
  • $\begingroup$ No. b is not equal to 0. b mod n is equal to zero. $\endgroup$ – therobotgeek Jun 28 '16 at 10:02
  • $\begingroup$ @Shaktal Okay, so is it a given statement that the second mod has no effect? Can I take that as an axiom? $\endgroup$ – therobotgeek Jun 28 '16 at 10:05
  • $\begingroup$ @SrinidhiS No, it's not an axiom. It follows from the axioms (at least, it does if your axioms are somewhat reasonable), and is therefore a theorem. $\endgroup$ – Arthur Jun 28 '16 at 10:06
1
$\begingroup$

You can see that $(a \bmod{n})\bmod{n}$ must be equivalent to $a\bmod{n}$. This is obvious because $a \bmod{n} \in [0,n-1]$ and so the second $\operatorname{mod}$ cannot have an effect.

Moreover, if we consider what the $\operatorname{mod}$ operation does, then it makes sense that if $b\mod{n} = 0$ then we would expect $$a+b\equiv a\pmod{n}$$

$\endgroup$

Your Answer

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

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