# How do you solve the following a - b(mod5) = a + b(mod5)?

attempted solution:

a - b(mod5) = a + b(mod5)

2a(mod5) = 0

a = 5

5 + b mod 5 = 5 - b mod 5

b mod 5 = -b mod 5

b = 0

-
Almost: $5\bmod 5=0$, so you should have $a=0$, not $a=5$, if you’re working in the usual residue system $\{0,1,2,3,4\}$. If you’re working over the integers, and the starting point is actually $a-b\equiv a+b\pmod 5$, then the solution is that $a$ and $b$ can be any multiples of $5$. – Brian M. Scott Nov 30 '12 at 0:18
@BrianM.Scott: In the usual residue system, can't $a$ be anything? $3-5\equiv 3+5 \pmod 5$ – Ross Millikan Nov 30 '12 at 0:36
Is this a single equation or a system of 2 equations? Where does that $2a\equiv0\pmod5$ come from? – Mike Nov 30 '12 at 1:08
so it's the other way around a = 0 and b = 5?> in R? is 0 a multiple of 5? – internetlearning Nov 30 '12 at 2:15
what's the step by step solution? – internetlearning Nov 30 '12 at 2:15

If you're working in the usual residue system of $\{0, 1, 2, 3, 4\}$, and $b = 0$, $a$ can be any number $n$ in the set, that is, $a-0 = a+0 \pmod 5 \iff a = a \pmod 5$ which is true for any $a$. Solutions of the form $(a, b)$ are given by $\{(a, 0): a \in \{0, 1, 2, 3, 4\}\}$

Similarly, if you're working over the integers, then provided $b$ is any integer multiple of $5$ (that is, provided $b\equiv 0 \bmod 5),$ then $a-b\equiv a+b\pmod 5 \iff a - 5k \equiv a + 5k \pmod 5$, which is true for all integer values of $a$, $k \in \mathbb{Z}$. Solutions of the form $(a, b)$ are given by $\{(a, 5k): a, k\in \mathbb{Z}\}$.

-
what is a residue system? – internetlearning Nov 30 '12 at 2:13
Is simply means limiting the integers of concern, when considering $\mod n$, to $\{0, 1, 2, ...., n-1\}$. But if you are looking for all integer solutions for a and b, then the second part of the answer will give you that. – amWhy Nov 30 '12 at 2:19
why is b any integer multiple of 5? – internetlearning Nov 30 '12 at 2:21
if you subtract (a - b) - (a + b) = 0 (mod 5), you get a-a - b - b= -2b = 0 (mod 5). That happens if and only if b is a multiple of 5: $b\in \{...-10, -5, 0, 5, 10, ...\}$. – amWhy Nov 30 '12 at 2:32

From $a-b\equiv a+b \pmod 5$ you can derive $2b \equiv 0 \pmod 5$, so $b \equiv 0 \pmod 5$, but $a$ can be anything-it cancels. Try $a=3, b=5$, for example.

-