2

I'm very novice on congruences so please don't scold me too much :) So I have a system of equations like this:

$$\begin{cases}23d\equiv 1 \pmod{40}\\ 73d\equiv 1 \pmod{102} \end{cases}$$

And so from (1) I get $d=40k+7$. I plug it into (2) and I have $73(40k+7)\equiv 1 \pmod{102} \rightarrow 64k\equiv -6 \pmod{102}$.

That means $k = 51 n+27$, so plugging back to the first, we have $d=2040n+1087$ which means that any $d\equiv 1087 \pmod{2040}$ satisfies the system of equations here which is not true since 7 doesn't satisfy it while it does satisfy both of our equations.

How can I do it, then? Can I just see that $d=40k+7$ from the first and $d=102k+7$ from the second and just calculate $\begin{cases}d=40k+7 \\ d=102k+7 \end{cases}$ which is 7? Can I then be sure it's the only solution?

Jim
  • 30,682
Straightfw
  • 1,558

3 Answers3

3

There is an error in your arithmetic:

$$73*7 = 511 = 5*102 + 1$$

Thus when you substitute in $d = 40k + 7$ you should get $64k \equiv 0 \pmod{102}$ instead of $\equiv -6$.

Jim
  • 30,682
3

$$ \begin{align} 23d+40a&=1\tag{1}\\ 73d+102b&=1\tag{2} \end{align} $$ $73\times(1)-23\times(2)$ yields $$ 2920a-2346b=50\tag{3} $$ Solving $(3)$ using the Euclid-Wallis Algorithm: $$ \begin{array}{rrrrrrr|r} &&1&4&11&2&12\\\hline 1&0&1&-4&45&\color{#C00000}{-94}&\color{#00A000}{1173}&\color{#0000FF}{-4}\\ 0&1&-1&5&-56&\color{#C00000}{117}&\color{#00A000}{-1460}&\color{#0000FF}{5}\\ 2920&2346&574&50&24&\color{#C00000}{2}&\color{#00A000}{0}&\color{#0000FF}{50}\tag{4} \end{array} $$ Adding $2$ times the green column to $25$ times the red column gives the blue column, which tells $$ 2920(-4+1173k)+2346(5-1460k)=50\tag{5} $$ $(5)$ gives solutions to $(3)$ of $a=-4+1173k$ and $b=-5+1460k$. Plugging back into $(1)$ or $(2)$ yields $$ d=7-2040k\tag{6} $$ That is, $$ d\equiv7\pmod{2040}\tag{7} $$

robjohn
  • 345,667
1

Hint $\ $ It is much easier to solve if you factor the moduli, e.g.

$\left.\begin{eqnarray}\rm mod\ 5\!:&&\rm\ \ \ d\equiv \dfrac{1}{23}\equiv\, \dfrac{6}3\ \equiv\ 7\\ \\ \rm mod\ 8\!:&&\rm\ \ \ d\equiv \dfrac{1}{23}\equiv \dfrac{1}{-1} \equiv 7\end{eqnarray} \right\}\! \rm \iff d\equiv 7\ \ (mod\ 40)$

$\left.\begin{eqnarray} \rm mod\ 6\!:\ &&\rm\ d\equiv \dfrac{1}{73}\equiv \dfrac{1}{1}\ \equiv\ 7\\ \\ \rm mod\ 17\!:&&\rm\ d\equiv \dfrac{1}{73}\equiv \dfrac{35}{5}\equiv 7\end{eqnarray} \ \right\}\!\rm \iff d\equiv 7\ \ (mod\ 102)$

Bill Dubuque
  • 272,048
Math Gems
  • 19,574
  • This works deceptively well in this case since $d$ happens to be the same $\bmod{\ 40}$ and $\bmod{\ 102}$. However, other cases might require some extra Euclidean Algorithm work. – robjohn Mar 07 '13 at 22:01