-1

Question

Prove: $m \equiv p \pmod n$ if and only if $m\%n = p\%n$, where $a\%b$ is the remainder when $a$ is divided by $b$.

Normally I think it is just a definition, but now I meet a question to prove it, I find it hard to prove

if $m \equiv p \pmod n$ then $n\mid(m-p)$ (the question only give us $m \equiv p \pmod n$ if $n\mid(m-p)$)

in the first step, after getting this, I can substitute $m$ as $kn + r$ and $p$ as $k^\prime n + r^\prime$, so the statement can be proved, but how can I get $m \equiv p \pmod n$ then $n\mid(m-p)$?

I am not sure if my direction is not correct

  • In your substitution, you should get $kn+r=k'n+r'$ and then you just need to show that $r=r'$. – abiessu Jun 12 '23 at 04:28
  • 1
    You need to consider the definition of $a%b$ that you have been given. The statement is not necessarily true depending on how $a%b$ is defined. – David K Jun 12 '23 at 04:29
  • 1
    @DavidK the definition of a%b is the reminder and the range is [0, n), the equation of it is $a%b = a - floor( \frac {a}{b}) \dot n$ – Helen Guo Jun 12 '23 at 04:33
  • @abiessu Hi, I don't know how we can have kn + r = k'n + r', because m and p are different numbers – Helen Guo Jun 12 '23 at 04:37
  • $m$ and $p$ are (possibly) different numbers but so are $k$ and $k'$. – David K Jun 12 '23 at 04:39
  • "$m \equiv p \pmod n$ if $n|(m-p)$" can be a definition of $ \equiv \pmod n$. If it is given as a definition, then it is implicitly "if and only if". – David K Jun 12 '23 at 04:43
  • @DavidK, thank you so much, yes, this definition is given – Helen Guo Jun 12 '23 at 04:49

2 Answers2

2

Let $m=kn+r, p=k^\prime n+r^\prime$. Since $m\equiv p \pmod n\implies r=r^\prime$.

$m-p$=$kn+r-k^\prime n-r^\prime=(k-k^\prime)n$, which is clearly divisible by $n$.

And hence, $n\mid(m-p)$, $\boxed{Q.E.D}$

Usually this result is trivial.

IraeVid
  • 3,216
0

If $m=_n p$ then $m$ and $p$ have the same remainder, $r$, say, when divided by $n$, so $m=kn+r$ and $p=k'n+r$. Then $m-p=(k-k')n$, so is divisible by $n$.

mcd
  • 3,448