Suppose that $m$ and $n$ are positive integers and $\operatorname{hcf}(m,n) = 1$, and suppose that $a$ and $b$ are integers with $0\le a\le m,\ 0\le b\le n$. How would you use Euclid's algorithm to find integers $\alpha$ and $\beta$ such that $\alpha m + \beta n = a-b$? Hence explain how to find an integer $N$ such that $N \equiv a \pmod{m}$ and $N \equiv b \pmod{n}$.
-
I guess the question or the answer is the Bezout identity. – Berci Feb 22 '13 at 12:52
-
I doubt that linear-algebra will be a relevant tag once the user completes the question. – yearning4pi Feb 22 '13 at 12:54
-
The full text of the question is there, it just does not show (at least for me). If you try to edit,you'll see. If some kind soul would texify it... – lhf Feb 22 '13 at 13:22
2 Answers
Hint $\ $ Consider $\: N \,=\, a-\alpha\, m \,=\, b + \beta\, n\:$
To obtain $\ \alpha\,m + \beta\,n\, =\, a-b,\ $ scale the Bezout identity for $\ \gcd(m,n)=1\ $ by $\:a-b.\ $ Recall that the Bezout identity is easily computed by the extended Euclidean algorithm.
Note $\ $ Solving $\ \alpha\,m + \beta\,n\, =\, a-b\ $ for $\,\beta\,$ yields $\ \beta = (a-b)/n\pmod m,\ $ hence
$$\quad\ \ N \,\equiv\, b + \beta\, n \,\equiv\, b + n\ \left[ \dfrac{(a-b)}n\ {\rm mod}\ m\right]\!\!\pmod{mn}$$
See this post for more on this handy "Easy CRT" form of the Chinese Remainder Theorem.
The Bezout identity is a result of this
Theorem. hcf$(n, m) = d$ if and only if $\exists x, y\ (d = mx + ny)$
If you haven't seen the proof of this, you can look it up or ask here. It's a consequence of the Euclidean algorithm.
If we have integers $n, m$ such that hcf$(n, m) = 1$, the theorem tells us that we can find integers $x, y$ such that $$ \begin{align} 1 &= mx+ny &\text{so}\\ a-b &=mx(a-b)+ny(a-b)\\ &=m[x(a-b)]+n[y(a-b)]\\ &= m\alpha+n\beta \end{align} $$ Then, as Math Gems observed, we'll have $$ a-\alpha m =N= b+\beta n $$ so $N\equiv a\pmod{m}$ and $N\equiv b\pmod{n}$.
Example. Take $m=8, n=3$. By the Euclidean algorithm we find $$ 1=8(2)+3(-5)\quad\text{so }x=2, y=-5 $$ and so, with $a=5, b=2$ $$ a-b = 3 = 8(6)+3(-15)\quad \text{so }\alpha=10, \beta=-15 $$ and observe that $$ a-\alpha m = 5-10\cdot 8 = -43 = 2 + -15\cdot 3 = b+\beta n \quad\text{so }N=-43 $$ and we have $-43\equiv 5\pmod{8}$ and $-43\equiv 2\pmod{3}$.

- 8,718
-
The Theorem is not stated correctly, because $\exists x,y(d=mx+ny)$ remains true if $d$ is replaced by any multiple of $d$. Perhaps you intended the right side of the "if and only if" to be "$d|m$ and $d|n$ and $\exists x,y(d=mx+ny)$. – bof Nov 14 '14 at 10:07