2

I am trying to solve this system of equations:

$24x ≡ 12 \hspace{5pt} (\mathrm{mod} \hspace{2pt} 63)$

$x ≡ 2\hspace{5pt} (\mathrm{mod} \hspace{2pt} 27)$

So I know that the second equation is equivalent to $x=27y+2$, but when I plug it into $24x ≡ 12\hspace{5pt} (\mathrm{mod} \hspace{2pt} 63)$, I got $2y ≡ 3\hspace{5pt} (\mathrm{mod} \hspace{2pt} 7)$ and I don’t know what to do next... Did I do something wrong?

3 Answers3

1

$\!\!\bmod 7\!:\,\ 2y\equiv 3\equiv 10\iff y\equiv 5\iff y = 5\!+\!7n,\,$ hence

$x = 2\! +\! 27y = 2\!+\!27(5\!+\!7n) =\, \bbox[5px,border:1px solid #c00]{137+ 189n}\ $ is our solution.

Remark $\ $ For completeness below are the steps you omitted

$\!\!\bmod 27\!:\,\ x\equiv 2\iff x = 2\!+\!27y,\ y\in \Bbb Z\ $ so $\!\!\bmod 63:\,\ 24x = 24(2\!+\!27y) \equiv 12 \iff 18y \equiv 27\!\!\overset{\ \large \div 9}\iff \bmod 7\!:\,\ 2y \equiv 3$


It's trivial to compute $\,a/2\bmod m$ odd since $\,2\mid a\,$ or $\,2\mid a\color{#c00}{\!+\!m},\,$ being opposite parity, so choosing the rep $\,a\equiv a\!+\!m\,$ that is even makes the quotient exact, e.g. $\bmod 7\!:\,\ y\equiv 3/2 \equiv (3\!\color{#c00}{+\!7})/2\equiv 5$

More generally modular inverses and fractions can be easily algorithmically computed by the (fractional) extended Euclidean algorithm, or Gauss's algorithm, or inverse reciprocity, etc.

Bill Dubuque
  • 272,048
1

Do you know about modular inverse ?

Here you have $\quad 2y\equiv 3 \pmod 7$

Notice that when we multiply by $4$ we get $\quad 8y\equiv 12\pmod 7$

And since $8\equiv 1\pmod 7$ and $12\equiv 5\pmod 7$ we get in the end $\quad y\equiv 5\pmod 7$

We say that $4$ is the inverse of $2$, since $2\times 4\equiv 1\pmod 7$

Now replace $y=7k+5$ in $x=27y+2=137+189k$


Here is now a way to get to apply the Chinese remainder theorem.

$\begin{cases} 24x\equiv 12\pmod{63}\\x\equiv 2\pmod{27}\end{cases}$

The first thing to do is to use modular inverse to have equations of the form $x\equiv a_i\pmod {m_i}$

Unfortunately here $\gcd(24,63)=3$ thus $24$ does not have an inverse modulo $63$.

But since $12$ is also a multiple of $3$ we can divide the whole equation by the gcd.

We now have $\begin{cases} 8x\equiv 4\pmod{21}\\x\equiv 2\pmod{27}\end{cases}$

Since $8^{-1}\equiv 8\pmod{21}$ we multiply by $8$ in first equation.

$\begin{cases} x\equiv 11\pmod{21}\\x\equiv 2\pmod{27}\end{cases}$

We still can't apply CRT because the $m_i$ have common factors $21=3\times 7$ and $27=3^3$.

So we will split the first equation into two:

$\begin{cases} x\equiv 2\pmod{3}\\x\equiv 4\pmod{7}\\x\equiv 2\pmod{27}\end{cases}$

Now we have to deal with first and third equations, but notice that every solution of the third one is automatically solution of the first one.

So we can reduce the system to:

$\begin{cases} x\equiv 4\pmod{7}\\x\equiv 2\pmod{27}\end{cases}$

It has a unique solution modulo $7\times 27=189$ and applying the CRT gives $x\equiv 137\pmod{189}$

zwim
  • 28,563
0

$27 \times 24 = 648 \;\equiv 18 \mod(63).$

Therefore, the 2nd equation should be

$18y + 48 \;\equiv 24 \mod(63).$

user2661923
  • 35,619
  • 3
  • 17
  • 39