How to compute 8x≡33(mod35)?
I followed this video to solve this problem. Is there a better way?
My solution steps:
Divide both sides by 8:
x≡338−1(mod35)
35=338⋅8+2
338=2⋅168+18
2=18⋅8+1
Now put 1 by itself:
1=2−18⋅8
Now put 2 by itself from (1):
2=35−338⋅8
Now put 18 by itself from (2):
18=338−2⋅168
Now substitute 18 with (5) in (3) and simplify:
1=2−(338−2⋅168)⋅8
1=2−338⋅8−2⋅16
Now substitute 2 with (4) in (6) and simplify:
1=35−338⋅8−338⋅8−(35−338⋅8)⋅16
1=17⋅(35)−338⋅(8⋅8⋅8⋅16)
The solution is usually between 0 to 35. However, we get (−8⋅8⋅8⋅16), which is it too small..
Can anyone tell me where I went wrong?
Answer
We wish to find x such that 8x≡33(mod35).
Since 8 and 35 are relatively prime, we can use the extended Euclidean algorithm to express their greatest common divisor 1 as a linear combination of 8 and 35. We first use the Euclidean algorithm to solve for the greatest common divisor of 8 and 35.
35=4⋅8+38=2⋅3+23=1⋅2+12=2⋅1
We now work backwards to solve for 1 in terms of 8 and 35.
1=3−1⋅2=3−1⋅(8−2⋅3)=3⋅3−1⋅8=3⋅(35−4⋅8)−1⋅8=3⋅35−13⋅8
Since 3⋅35−13⋅8=1, −13⋅8≡1(mod35) If we multiply both sides of the congruence by 33, we obtain
33⋅−13⋅8≡33(mod35)−429⋅8≡33(mod35)(−13⋅35+26)⋅8≡33(mod35)26⋅8≡33(mod35)
Hence, x≡26(mod35).
Check: If x≡26(mod35), then 8x≡8⋅26≡208≡5⋅35+33≡33(mod35).
Note that this is a modification of Thomas Andrews' excellent answer and an elaboration on Bernard's answer. The theorem that states that we can express the greatest common divisor of two integers as a linear combination of those integers is known as Bezout's identity.
No comments:
Post a Comment