1

Solve for $x$: $5x =1 \bmod12$

By hit and trial i see that $x=5$ satisfies the above. But what is the procedure for doind this

Thanks

Gathdi
  • 1,402

1 Answers1

1

The solution is $x = 5^{-1} \pmod {12}$. Basically you want to calculate the modular inverse of $5 \pmod {12}$, which is represented as $5^{-1} \pmod{12}$. You can use the Extended Euclidean algorithm for that. But for small modulos, it's easier to just do trial and error. You want the unique number (modulo $12$) that when multiplied by $5$ will give you a result that is $1$ modulo $12$. You only have to test numbers in the range $1$ to $11$.

You can quite easily see that $(5)(5) = 25 \equiv 1 \pmod {12}$. So $5^{-1} \equiv 5 \pmod{12}$ and the solution is $x \equiv 5 \pmod{12}$.

Deepak
  • 26,801
  • 1
    I agree that trial and error is the right way to do this, but it seems more efficient to test numbers of the form $12n+1$ until you find one divisible by $5$. (Efficient not only because in this example $n=2$ already works but mainly because I find it easier to mentally test divisibility by $5$ than by $12$.) – Andreas Blass Aug 01 '16 at 05:32
  • @AndreasBlass Yes, this is true. In fact, I think I exploited this method somewhere on another question on this site, but I can't seem to find it. May have been a comment in response to someone else. – Deepak Aug 01 '16 at 05:50