1

We got introduced to the Chinese Reminder Theorem, but I still haven't quite grasped it and I have a problem that asks:

Find $x \bmod 77$ if $x \equiv 2 \pmod 7$ and $x \equiv 4 \pmod {11}$.

My attempt was like so: $$B = 7 * 77 * 11 = 5929$$ $$B_{1} = \frac{5929}{77} = 77$$ Using $B_{1}*x_{1} \equiv 1 \pmod {77}$: $$77x_{1} \equiv 1 \pmod {77} $$ $$x_{1} \equiv 78 \pmod {77}$$ So then would the $x$ be $78$?

Joffan
  • 39,627
KonoDDa
  • 123

5 Answers5

4

If $x\equiv 2\pmod 7$ then $x = 2+7k_1$ for some $k_1 \in \mathbb{Z}$. So substituting in your second equation you get $2+7k_1\equiv 4 \pmod {11}$, which gives you $k_1 \equiv 5\pmod{11}$, because $7^{-1}\equiv8\pmod{11}$. Hence $k_1 = 5+11k_2 $, for some $k_2 \in \mathbb{Z}$, and therefore $$x = 2+7(5+11k_2)=37+77k_2\equiv37\pmod{77} $$

bsd
  • 233
  • 1
    Generally it ends up being simpler ordering so we do the smaller moduli last (vs, first as above), e.g. here $!\bmod 7!:,\ 2 \equiv x \equiv 4!+!11\color{#c00}j \equiv 4!-!3j !\iff! 3j\equiv 2\equiv 9!\iff! \color{#c00}{j=3},$ so $,x\equiv 4!+!11(\color{#c00}3)\equiv 37\pmod{!77}\ $ Because the final modulus is smaller ($7$ vs. $11$), the final equation (and inversion) in easier to solve, viz. $3j\equiv2\pmod{!7}$ vs. $7k\equiv 2\pmod{!11}.,$ The difference in work can be much more dramatic for moduli whose size differs more greatly. – Bill Dubuque Sep 23 '17 at 12:47
4

$\bmod 7\,\&\,11\!:\ 2x\equiv -3\iff \bmod 77\!:\ 2x\equiv -3\equiv 74\iff x\equiv 37$

Bill Dubuque
  • 272,048
2

Let us use the Euclidean algorithm to express $\gcd(7,11)$ as a linear combination: $$4 = 11 - 7\\ 3 = 7 - 4 = 2 \cdot 7 - 11 \\ 1 = 4 - 3 = 2 \cdot 11 - 3 \cdot 7.$$ Now, $x = (2 \cdot 11 - 3 \cdot 7) x = 2 (11x) - 3 (7x)$. By the given congruences, $11x \equiv 11 \cdot 2 = 22 \pmod{77}$ and $7x \equiv 7 \cdot 4 = 28 \pmod{77}$. Therefore, $x \equiv 2 \cdot 22 - 3 \cdot 28 = -40 \equiv 37 \pmod{77}$.

(This is hopefully closer to what you were hinting at in your comments as the method of solving CRT problems that your source is using.)

  • I didn't see them use the Euclidean algorithm, however, is there only one solution or can there be multiple(possibilities)? – KonoDDa Sep 22 '17 at 22:21
  • 1
    Part of the statement of the Chinese Remainder Theorem is: for $n_1, n_2, \ldots, n_k$ pairwise relatively prime, $x \equiv a_1 \pmod{n_1}, \ldots, x \equiv a_k \pmod{n_k}$ has a unique solution modulo $n_1 \cdots n_k$. (Though as commented elsewhere, there are certainly many different computational paths to find that unique solution.) – Daniel Schepler Sep 22 '17 at 22:28
2

You have to start from a Bézout's relation between $7$ and $11$: $$2\cdot 11-3\cdot7=1.$$ Then the solutions to a system of congruences $\;\begin{cases}x\equiv a\pmod 7\\x\equiv b\pmod{11}\end{cases}$ is $$x\equiv a\cdot 2\cdot 11-b\cdot 3\cdot 7\pmod{7\cdot 11}$$ Here you obtain $x\equiv 44-84=-40\pmod{77}$. The smallest positive integer staisfying this congruence is $-40+77=37$.

The present case is trivial, but the general method to find a Bézout's relation between two numbers is the extended Euclidean algorithm.

Bernard
  • 175,478
  • Why do you claim "you have to start from Bezout relation"? There are many ways to solve CRT systems that do not start by Bezout. – Bill Dubuque Sep 23 '17 at 02:35
  • There's an ellipsis in my wording: ‘In the way I'm going to explain, you have …’ – Bernard Sep 23 '17 at 08:44
  • Ok, that's better. Note that it's simpler to first $\rm\color{#c00}{double}$ the congruences, because it's simpler to write $,\color{#c00}2(b!-!a) = \color{#0a0}4$ (vs. $b!-!a=2)$ in the form $,11j!+!7k,$ (viz. $11!-!7=\color{#0a0}4,$ is obvious). Equivalently, both congruences are equivalent to $,\color{#c00}2x\equiv -3,$ when $,\rm\color{#c00}{doubled},,$ as in my answer. $\ \ $ – Bill Dubuque Sep 23 '17 at 13:23
1

I don't know if this is what you have on your mind, but I would do it like this:

$x=7a+2$ and $x= 11b+4$ for some integers $a,b$ so $7a= 11b+2$ and thus $7|11b+2$. Multiply this with 2 and we get $7|22b+4$ so $7|b-3$. Now we can write $b=7t+3$ and thus $x=77t+37$. So $x \equiv 37 \pmod {77}$.

nonuser
  • 90,026
  • I was going back YouTube tutorial and the person used that formula to find x, but that exactly wasn't the CRT. He was finding the x for the CRT: Z = B1X1C1....So that had me lost. – KonoDDa Sep 22 '17 at 22:00
  • @KonoDDa It's easier if we multiply by $2$ right at the start, i.e.double the congruences. Then they both unify to $,2x\equiv -3$ and the rest is trivial - see my answer (and my comment on Bernard's answer). – Bill Dubuque Sep 23 '17 at 13:52