How to solve this linear congruence equation and more general cases? Okay so I'm trying to solve $5x \equiv 7 \mod 11$ and this is the particular example that I can't do. Can someone help me learn how to solve these and more general examples $ax \equiv b \mod n$. I believe there is only one solution (well infinitely many but they are all the same $\mod n$) $a$ is coprime to $b$  however I still need help solving these and also how to solve it when it is a simultaneous linear congruence. Any help?
Thanks.
 A: The idea is to multiply the relation with the inverse of $a$, in $\mathbb Z_n$, i.e. to find a $c$ such that $ac\equiv 1\pmod n$. When $n$ is prime, this $c$ always exists and it is is equal to $a^{n-2} \pmod{n}$. (see Fermat's little theorem) In your case, $5^4=625\equiv 9\pmod{11}\Rightarrow 5^8\equiv 81\equiv 4\pmod {11}\Rightarrow 5^9\equiv 20\equiv 9\pmod{11}$ Then $x\equiv 9\times 7\equiv 8\pmod{11}$.
If $n$ is not prime, you still have to find the inverse which may or may not exist. If $\gcd(a,n)=1$, it still exists. If $\gcd(a,n)=d$, you should be able to divide the equaton by $d$ (otherwise it has no solution) example $4x\equiv 4\pmod 6\Rightarrow 2x\equiv 2\pmod 3$.
For more equations, you should look into the Chinese remainder theorem.
A: Since 11 is a prime number, any number congruence it has an inverse:
$$5x \equiv 7 \mod 11$$
$$5 \times 9 =45= 4\times 11+1$$
$$5^{-1} \equiv 9 \mod 11$$
$$5^{-1} \times 5 x\equiv 5^{-1} \times 7 \mod 11$$
$$x\equiv 9 \times 7 \equiv 63 \equiv 8 \mod 11$$
$$x\equiv  8 \mod 11$$

If 11 was not prime, you had to try 11 cases from 1 to 11 (try and error) to find primary answers. 
A: Write $5x\equiv7\mod11$ as $5x=11k+7,k\in\mathbb{N}$. Now divide both sides by $5$:
$$x=\dfrac{11k+7}{5}$$
Notice that $x$ is integer iff $k\equiv3\mod5$, so for that $k$ we have $x\equiv\text{const}\mod11$. From this you can see that
$$x\equiv\dfrac{11\cdot3+7}{5}\equiv8\mod11$$
