0

Using the extended euclidian algorithm and the Chinese remainder theorem, I am able to find a solution to the following equation system:

\begin{align*} x \equiv 4 \bmod 39\\ x \equiv 5 \bmod 70 \end{align*}

The issue I have is that while I am able to find the solution (which is $355$), many steps of the Chinese remainder theorem require multiplying large numbers together (eg: $4\cdot 31\cdot34$) and finding the result of modulo operations on other large numbers (eg: $11275 \bmod 355$).

What seems impractical about this is that this is destined to be part of a handwritten test where calculators aren't authorized. In the previous question of the test, it was asked to compute the modular inverse of $39 \bmod 70$, which is $9$ and from what the test specifies this should help solve the system, unfortunately I don't see how to do this.

Is there a simpler way?

Bonnaduck
  • 4,058
Pop Flamingo
  • 807
  • 1
  • 8
  • 17
  • These are operations well within the range of pen and paper working. The product is $4216$ done mentally and checked. You can find $11275 \bmod 355$ with two cycles of long division. Your course expects you to be able to do this. Be glad they are not $10$ or $20$ digits. – Ross Millikan Jan 02 '22 at 23:10
  • 1
    There are only two equations. Starting with the bottom one, we now try to solve $5+70n\equiv 4 \pmod {39}$, which is not difficult. It is equivalent to $8n\equiv 1 \pmod {39}$ and the inverse of $8\pmod {39}$ is obvious. – lulu Jan 02 '22 at 23:11

3 Answers3

1

let $x=39y+4$
$39y+4\equiv 5\pmod{70}$
$39y\equiv 1\pmod{70}$
the inverse of 39 mod 70 is 9
$y\equiv 9\pmod{70}$
$y=70z+9$
$x=39(70z+9)+4=39*70z+355$
$x\equiv 355\pmod{39*70}$

cineel
  • 1,536
1

This can be done entirely in your head.

From the second congruence, we know that $x=5+70n$ for some $n$. Thus we seek to solve $$5+70n\equiv 4\pmod {39}$$

But this is equivalent to $$8n\equiv 1 \pmod {39}\implies n\equiv 5\pmod {39}$$ and we are done.

lulu
  • 70,402
  • this method seems easier because the inverse of 8 mod 39 is easier to compute than the inverse of 39 mod 70. – cineel Jan 02 '22 at 23:26
  • @cineel. Indeed, it's always better to work with smaller moduli. Were it necessary, you could go further and work modulo $3,13$ separately, but this is not necessary. – lulu Jan 02 '22 at 23:30
  • As I explain in my answer, the method used above a special case of a general CRT formula. It's not clear what method was used to compute $1/8\bmod 39$ but thar too can be viewed as a special case of various general methods of computing modular fractions - see my "twiddling" link. – Bill Dubuque Jan 03 '22 at 03:09
  • @cineel Usually inverting wrt least modulus is easier, but here $,39^{-1}\equiv 9\pmod{!70},$ is easy too

    $!\bmod 35!:\ \dfrac{1}{39}\equiv \dfrac{36}4_{\phantom{|_|}}!!!\equiv 9.,$ It's also true $!\bmod 2!:\ \overbrace{39^{-1}\equiv 9}^{\textstyle\ 1^{-1}\equiv 1},$ so it's also true $!\bmod 2\cdot 35,$ (by $,2,35\mid 9\cdot 39-1\Rightarrow ,2\cdot 35\mid 9\cdot 39-1).,$ Above we twiddled the fraction to get an exact quotient $36/4$ (cf. link in my answer)

    – Bill Dubuque Jan 03 '22 at 11:10
  • Thank you for your answer, this was very helpful. – Pop Flamingo Jan 06 '22 at 08:02
1

By the Easy CRT Formula, & by twiddling to an $\color{#c00}{\text{exact quotient}\equiv 5}$

$\ \begin{align}\rm x&\equiv\color{#0a0}{5\!\!\!\pmod{\!70}} \\ \rm x&\equiv \color{#90f}{4\!\!\!\pmod{\!39}}\end{align} \!\!\iff\! $ $ x \equiv\, \color{#0a0}{5\! +\! 70} \bigg(\!\underbrace{\dfrac{\color{#90f}4\!-\!\color{#0a0}5}{\color{#0a0}{70}}\!\color{#90f}{\bmod{39}}}_{\small{\dfrac{\color{#90f}{-}\color{#0a0}1}{\color{#0a0}{70}}\ \,\equiv\,\ \color{#c00}{\dfrac{-40}{-8}\ \equiv\ \large 5}}}\!\bigg)$ $\equiv 355\pmod{\!\color{#0a0}{70}\cdot \color{#90f}{39}}$

Bill Dubuque
  • 272,048