<s>[INST] Finding the inverse of a number under a certain modulus How does one get the inverse of 7 modulo 11?
I know the answer is supposed to be 8, but have no idea how to reach or calculate that figure.
Likewise, I have the same problem finding the inverse of 3 modulo 13, which is 9.
 [/INST] To find the inverse of $7$ modulo $11$, we must solve the equivalence $7x \equiv 1 \pmod{11}$.  To do this, we use the Extended Euclidean Algorithm to express $1$ as a linear combination of $7$ and $11$.  The coefficient of $7$ will be the inverse modulo $11$.  By the Euclidean Algorithm,
\begin{align*}
11 & = 1 \cdot 7 + 4\\
7 & = 1 \cdot 4 + 3\\
4 & = 1 \cdot 3 + 1\\
3 & = 3 \cdot 1
\end{align*}
We now take the equation $4 = 1 \cdot 3 + 1 = 3 + 1$, solve for $1$, then work backwards until we obtain $1$ as a linear combination of $7$ and $11$.
\begin{align*}
1 & = 4 - 3\\
  & = 4 - (7 - 4)\\
  & = 2 \cdot 4 - 7\\
  & = 2(11 - 7) - 7\\
  & = 2 \cdot 11 - 3 \cdot 7
\end{align*}
Since $2 \cdot 11 - 3 \cdot 7 = 1$, 
$$-3 \cdot 7 = 1 - 2 \cdot 11 \Longrightarrow -3 \cdot 7 \equiv 1 \pmod{11}$$
Hence, $-3$ is the inverse of $7 \pmod{11}$.  To express the inverse as one of the residues $\{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10\}$, we add $11$ to $-3$ to obtain $-3 + 11 \equiv 8 \pmod{11}$.  Hence, $7^{-1} \equiv 8 \pmod{11}$.  
Check:  $7 \cdot 8 \equiv 56 \equiv 1 + 5 \cdot 11 \equiv 1 \pmod{11}$.
To verify you understand the algorithm, try to find the inverse of $3$ modulo $13$.
</s>