Swapping numbers in congruence

222 Views Asked by At

If I have $12 \equiv 2$ (mod $10$), and then I swap $12$ for $10$ I get $10 \equiv -2$ (mod $12$). So it just negates the residue number.

I was wondering if this is some property or something. Suppose I have $12 \equiv 2$ (mod $5$) then $5 \equiv -2$ (mod $12$) is not true, but for some multiple of $5$ it would be though, namely $5*2$.

Can anyone provide any insight into this?

2

There are 2 best solutions below

0
On

$a\equiv r \pmod{m}\iff \exists k\mid a=mk+r$

It can be rewriten : $mk=a-r\Longrightarrow mk\equiv -r \pmod{a}$

In your example $k=1$ so you ended up with $m\equiv -r\pmod{a}$ and in fact this will stay true for any $k$ such that $k\equiv 1\pmod {a}$.

But in general $k$ can take any value between $0$ and $a-1$.

1
On

So you have seen that $$ \begin{split} 12 &= 1\times 10 + 2 \\ 10 &= 1\times 12 - 2 \end{split} $$ This was easy to do, just throwing the $2$ to the other side of the equation. But then if you look at $$ \begin{split} 12 &= 2\times 5 + 2 \\ 2 &\neq k\times 12 - 2 \end{split} $$ The difference here is that the factor in front of the "modulus" is not one. If it's one, the logic of the first equation always works. Therefore, your observation is true if the integer division between the left-hand-side and the modulus results in one. In other words $$ \begin{split} A &= 1\times B + R \\ B &= 1\times A - R \end{split} $$