1
$\begingroup$

I want to find all integer solutions ($x$ value) the following equation:

$((2(x+2))\mod 3+(x-3)\mod 2+3)\mod 5 = 3$

I have simplified the above equation as

$((2x+4))\mod 3+(x-3)\mod 2+3)\mod 5 = 3$

$((2x+3+1))\mod 3+(x-3)\mod 2+3)\mod 5 = 3$

$((2x+1) \mod 3 + (x-1)\mod 2 +3)\mod 5$ ==> I used the fact that $(k+3)\mod 3 = k\mod 3 = (k-3)\mod 3$

I can only solve it by such reasoning methods. Is there any specific fixed way or algorithm to solve such expressions?

1 Answers 1

0

You can continue simplifying : $(2x+1)\mod 3+(x-1)\mod 2\equiv 0\mod 5$

So $2x+1=3p+r$ and $x-1=2s+u$ and $u+r=5k$ but since $r\in\{0,1,2\}$ and $u\in\{0,1\}$ the only possible multiple of $5$ is $0$.

Thus $u=r=0$.

$\begin{cases} 2x+1\equiv 0\mod 3\iff 2x\equiv -1\equiv 2\mod 3\iff x\equiv 1\mod 3\\ x-1\equiv 0\mod 2\iff x\equiv 1\mod 2 \end{cases}$

So finally $\quad x=6k+1$.

The method is to try if possible to arrive at a system of $x\equiv a_i\mod p_i,\ i=1..n$ then you can apply chinese theorem.


When having a look at your equation :

$f(x)=(3(2(x\mod 2)+2 - (x\mod 4)))\mod 4 + (x\mod 8) = 9$

we first notice there are three modulo used $2,4$ and $8$, so if you are to find an $x$, the Chinese remainder theorem states that $x=lcm(2,4,8)a+t=8a+t$ with $t\in\{0,1,2,3,4,5,6,7\}$.

The success of the method resides in the fact that only $8$ values for $t$ need to be plugged and tested in the equation.

Note: since $(x\mod 2,4,8)=(t\mod 2,4,8)$ just replace $x$ by $t$ in the equation and try all values.

$\begin{array}{c|ccc|c} t & t\%2 & t\%4 & t\%8 & f(t) \\ \hline 0 & 0 & 0 & 0 & 2 \\ 1 & 1 & 1 & 1 & 2 \\ 2 & 0 & 2 & 2 & 2 \\ 3 & 1 & 3 & 3 & 6 \\ 4 & 0 & 0 & 4 & 6 \\ 5 & 1 & 1 & 5 & 6 \\ 6 & 0 & 2 & 6 & 6 \\ 7 & 1 & 3 & 7 & 10 \end{array}$

And you see that your equation has no solution, but solving it was a very automated process.

  • 0
    Thank u 4 ans. I tried solving (3(2(x%2)+2 - (x%4))%4 + (x%8) = 9. A random my own equation. When I tried your method, it looks like there are lot of equations for x which needed to be evaluated. I reduced this equation to (6r-3s)%4 + t =9 where x = 8a + t, x = 2b+r and x = 4c+s; Finding a x satisfying all these looks complex. What I want is a more specific structured method.2017-02-28
  • 0
    Integrated answer to this comment in my answer.2017-02-28
  • 0
    Thank you so much for the clear explanation. This must be obvious for me. Sorry for being too ignorant.2017-03-01
  • 0
    Don't be sorry for this. The arithmetic theory has rather complicated to prove theorems, yet a lot of them are fortunately easy to use. This is the case for Chinese remainder theorem, a powerful tool indeed. Another useful tool is totient function, theoretically scary but a pleasure to apply with blind eyes (e.g. prove in one line that any number ending with 7 has a multiple of the form 1...1111).2017-03-01