1
$\begingroup$

I'm having trouble approaching the following problem:

Solve the following system of equation -

$$3x+5y\equiv 14\mod 17$$ $$7x+3y\equiv 6\mod 17$$

Multiplying the top by $3$ and the bottom by $5$, I get $x = -3/5$ and $y = 51/15$, but I'm unsure how to apply (mod $17$) with $2$ variables

2 Answers 2

3

So what you do is elimination of variables, and then deal with it differently:

start by eliminating $y$: multiply the first equation by three, second equation by five, then you get: $$ 9x+15y \equiv 42 (\equiv 8) \mod 17 ; 35x+15y \equiv 30 (\equiv 13) \mod 17 $$

Now, subtract the first equation from the second, and you get: $$ 26x \equiv 5 \mod 17 $$

This has to be solved, but we can do this through the reverse-Euclid algorithm: we know that there exist integers $x,y$ such that $17x+26y=1$ by Bezout's theorem. So the question is what are these $x$ and $y$?

To do this, note that: $$ 26 = (17 \times 1)+9 ; 17 = (9 \times 1) + 8; 9 = (8 \times 1)+ 1 $$

So we cleverly reverse this procedure: $$ 1 = 9-(8 \times 1) = (26-17 \times 1) - (17-9 \times 1) = (26-17)- (17-(26-17)) = 26-17-17+26-17 = 2 \times 26-3 \times 17 $$

Therefore, $x=2$ satisfies the equation $26x \equiv 1 \mod 17$. Multiply by $5$ and we see that $x=2 \times 5=10$ satisfies $26x \equiv 5 \mod 17$.

Hence, $x=10$ is a solution. Substituting this in the second equation, we see that $70+3y \equiv 6 \mod 17$, which simplifies to $3y \equiv -64 \mod 17$, or $3y \equiv 4 \mod 17$. You can check again via reverse Euclid: $$ 17 = (3 \times 5)+2 ; 3 = (2 \times 1)+1 $$ Therefore $$ 1 = 3-(2 \times 1) = 3 - (17 - 3 \times 5) = 3 \times 6-17 \times 1 $$ So $y=6$ satisfies $3y \equiv 1 \mod 17$, so multiply by four to get $3y \equiv 4 \mod 17$ (for $y=24$, or $y=7$ when reducing mod $17$).

So the answer is $x=10,y=7 \mod 17$. Let's check this: $$ 3x+5y = 30+35 = 65 \equiv 14 \pmod{17} \\ 7x+3y = 70+21 = 91 \equiv 6 \pmod{17} $$

Hence the equation is solved.

  • 0
    +1. Nice answer. Just a thing, you can use \pmod{17} instead of \mod 17 :)2017-01-13
  • 0
    Oh, I see. Thank you, @Xam2017-01-13
  • 0
    Thank you for the help! I'm sorry to bring this back up but I'm going back and reviewing but don't understand how you computed the reverse Euclid algorithm and got x=22017-02-05
  • 0
    It is a question of substitution, @Ashley. When I computed the gcd as $1$, I used three equations, all written on the same line. I want to write $1$ in terms of $26$ and $17$, so first I write it in terms of $9$ and $8$, then I write $9$ and $8$ in terms of $17$ and $26$ using the previous equations. If you see, all that I am doing is really reversing the procedure. Try it with smaller numbers like $7,5$ if you like.2017-02-06
1

A little more automatic: obtain the reduced row echelon form of the augmented matrix in the field $\mathbf Z/17\mathbf Z$. \begin{align} &\begin{bmatrix}3&5 &\color{red}{14}\\7&3&\color{red}{6}\end{bmatrix}=\begin{bmatrix}3&5 &\color{red}{-3}\\7&3&\color{red}{6}\end{bmatrix}\stackrel{R_1\leftarrow 6R_1}{-\!\!\!-\!\!\!-\!\!\!\rightsquigarrow}\begin{bmatrix}1&-4 &\color{red}{-1}\\7&3&\color{red}{6}\end{bmatrix}\stackrel{R_2\leftarrow R_2-7R_1}{-\!-\!\!\!\rightsquigarrow}\begin{bmatrix}1&-4 &\color{red}{-1}\\0&-3&\color{red}{-4}\end{bmatrix}\\ \stackrel{R_2\leftarrow -6R_2}{-\!\!\!-\!\!\!-\!\!\!\rightsquigarrow}&\begin{bmatrix}1&-4 &\color{red}{-1}\\0&1&\color{red}{7}\end{bmatrix}\stackrel{R_1\leftarrow R_1-4R_2}{-\!\!\!-\!\!\!-\!\!\!\rightsquigarrow} \begin{bmatrix}1&0 &\color{red}{-7}\\0&1&\color{red}{7}\end{bmatrix} \end{align} The solution is $\;\begin{bmatrix}\color{red}{-7}\\\color{red}{7}\end{bmatrix}=\begin{bmatrix}\color{red}{10}\\\color{red}{7}\end{bmatrix}$.

  • 0
    This is a nice answer too, but I doubt the OP knows what a field is.2017-01-13
  • 0
    He might know $\mathbf Z/n\mathbf Z$, though.2017-01-13