0

Solve in $Z_{601}$ the following equation:

$327x + 208 = 0$

How do you solve this one ? I am clueless, I have searched everywhere and I cannot find a somewhat close solved example.

3 Answers3

3

We want to solve

$$\begin{align}327x &\equiv -208 \pmod {601}\\ &\equiv 393 \pmod{601}\end{align}$$

By using the extended euclidean algorithm one has

$$327 \cdot (533) + 601 \cdot (-290) = 1$$

or taking everything modulo $601$,

$$327 \cdot 533 \equiv 1 \pmod {601}$$

By the definition of inverse, $327^{-1} = 533$ (in $\mathbb{Z}_{601}$). Hence,

$$\begin{align}x &\equiv 393 \cdot 327^{-1} \pmod{601}\\ &\equiv 393 \cdot 533 \pmod{601}\\ &\equiv 321 \pmod {601}\end{align}$$

so we conclude that if $x$ gives a remainder of $321$ when divided by $601$, then it is a solution. Hence $x = 321 + 601n$ for $n \in \mathbb{Z}$.

Yiyuan Lee
  • 14,435
  • Thank you for the explanation, but I don't understand why $393 * 533 (mod 601) ≡ 321$, can you please elaborate? – southpaw93 Sep 13 '15 at 13:20
  • You may multiply out $393 \cdot 533 = 209469$ as per normal and use long division by $601$ to show that $393\cdot533 = 209469 = 348\cdot 601 + 321$. – Yiyuan Lee Sep 13 '15 at 13:24
  • So after I did $393⋅533$ and got $209469$ I divided it by $601$ and the result is $348.5341$ but I still don't understand how to come up with $321$ – southpaw93 Sep 13 '15 at 13:32
  • You need to use the non-calculator method to come up with the quotient and remainder for the division. The remainder will turn out to be $321$. – Yiyuan Lee Sep 13 '15 at 13:35
  • 1
    ohh I see now, it's $209469 - 348*601 = 321$ got it, thanks :D – southpaw93 Sep 13 '15 at 13:36
  • another question, how do I know that $327^{-1} = 533$ ? in $Z_{601}$ , I mean, how do I find it fast? without computing every number from 0 to 600 in order to find it. – southpaw93 Sep 13 '15 at 13:40
  • From the extended euclidean algorithm, we have shown that $327 \cdot 533 \equiv 1 \pmod {601}$. Since $533$ is the number that gives $1$, the identity element, when multiplied with $327$, then by the definition of an inverse element, $533$ must be the inverse element of $327$. – Yiyuan Lee Sep 13 '15 at 13:42
2

You have to find the inverse of $327\bmod601$. This done done with the Extended Euclidean algorithm:

$$\begin{array}{l@{\qquad}rrrr} \hline \text{Successive Divisions}& r_i & u_i & v_i & q_i\\ & 601 & 0 & 1 & \\ 601= {\color{red}1} \times 327 +\color{blue}{274} & 327 &1 & 0 & \color{red}1 \\ 327 = {\color{red}1} \times 274 + \color{blue}{53} & \color{blue}{274} & -1 & 1 & \color{red}1 \\ \hline 274 = {\color{red}5} \times 53 + \color{blue}{9} & \color{blue}{53} & 2 & -1 & \color{red}5 \\ 53 = {\color{red}5} \times 9+ \color{blue}{8} & \color{blue}{9} & -11 & 6 & \color{red}5 \\ 9 = {\color{red}1} \times 8+ \color{blue}{1} & \color{blue}{8} & 57 & -31 & \color{red}1 \\ & \color{blue}{1} & -68 & 37& \\ \hline \end{array}$$ Thus we have the Bézout's relation: $\;-68\cdot327+37\cdot 601=1$, which implies $$327^{-1}\equiv -68\mod 601$$ and $$x=-327^{-1}\cdot 208=68\cdot208\equiv 321\mod 601.$$

Bernard
  • 175,478
  • what does $u_i$ and $v_i$ represent? – southpaw93 Sep 13 '15 at 14:18
  • The Extended Euclidean algorithm asserts that not only the last non zero remainder has Bézout's coefficients $u$ and $v$, but also all intermediate remainders $r_i$ have too; it is these coefficients that I denote $u_i$ and $v_i$ (the index $i$ corresponds to the $i$-th division of the Euclidean algorithm). The two given numbers are considered as remainders of index $-1$ and $0$ respectively. Is that clear? – Bernard Sep 13 '15 at 14:26
  • not really, I don't understand how to compute them for each step, and why at the end they equal to $-68$ and $37$.... – southpaw93 Sep 13 '15 at 14:28
  • Well, there is a linear recurrence relation between the successive remainder: from the $i$-th division, $;r_{i-1}=q_ir_i+r_{i+1}$, which can be written as $$r_{i+1}=r_{i-1}-q_ir_i$$. By projection we have the same relation between Bézout's coefficients: $u_{i+1}=u_{i-1}-q_iu_i$. Thus to create a further line, you take what is found two lines above, and substract $q_i$ times the above line. – Bernard Sep 13 '15 at 14:34
  • why is $ 601 $ $0$ $1$ as starters? are $0$ and $1$ chosen arbitrary ? – southpaw93 Sep 13 '15 at 14:50
  • 1
    No: it means $601=0\cdot327+1\cdot 601$ (and similarly $;327=1\cdot327+0\cdot 601$). That is the initialisation of the recurrence (which is of order $2$, I recall). – Bernard Sep 13 '15 at 14:57
  • I understand now, thank you so much :) – southpaw93 Sep 13 '15 at 14:58
  • You're welcome. I didn't give a full justification of the computations, hoping the layout of the algorithm would speak for itself, maybe with the help of Wikipedia… – Bernard Sep 13 '15 at 15:02
0

Here is another implementation of the Euclidean Algorithm.

Using the Extended Euclidean Algorithm as implemented in this answer to solve $$ 327x+601y=\gcd(327,601) $$ we get $$ \begin{array}{r} &&1&1&5&5&1&8\\\hline 1&0&1&-1&6&-31&37&-327\\ 0&1&-1&2&-11&57&-68&601\\ 601&327&274&53&9&8&1&0 \end{array} $$ This says that $$ 601(37)+327(-68)=1 $$ which means that in $\mathbb{Z}_{601}$ $$ 327(-68)=1 $$ Multiply by $-208$ to get $$ 327(14144)=-208 $$ so the answer is $14144=321$ in $\mathbb{Z}_{601}$.

robjohn
  • 345,667