1

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?

  • So you want to prove $(a+0)\pmod n=a\pmod n?$ – awllower Jun 28 '16 at 10:01
  • 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? – Thomas Russell Jun 28 '16 at 10:02
  • No. b is not equal to 0. b mod n is equal to zero. – therobotgeek Jun 28 '16 at 10:02
  • @Shaktal Okay, so is it a given statement that the second mod has no effect? Can I take that as an axiom? – therobotgeek Jun 28 '16 at 10:05
  • @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. – Arthur Jun 28 '16 at 10:06
  • @Arthur Thanks for the clarification. – therobotgeek Jun 28 '16 at 10:07
  • That being said, to me, mod means something else. To me, it's not an operation you do to a number, so $a\mod n$ doesn't mean anything. I see it as a clarification of $\equiv$. So I write $a+b\equiv c$, and then, since $\equiv$ may mean different things in different contexts, I add a $\pmod n$ at the end to show what $\equiv$ means. So in total, I would write$$a+b\equiv c\pmod n$$and not$$a+b\mod n=c\mod n.$$ It changes a bit how you think about modular arithmetic, and in my opinion, it makes life a bit easier, since questions like yours here doesn't even appear (modding twice just isn't done). – Arthur Jun 28 '16 at 10:14

1 Answers1

3

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}$$

Thomas Russell
  • 10,425
  • 5
  • 38
  • 66