50 lines
1004 B
TeX
50 lines
1004 B
TeX
\section{Bonus}
|
|
|
|
\problem{}
|
|
Find the inverse of 19 in $\mathbb{Z}_{23}$ \\
|
|
\hint{Recall the Euclidean Algorithm}
|
|
|
|
|
|
\begin{solution}
|
|
17
|
|
\end{solution}
|
|
\vfill
|
|
|
|
\problem{}
|
|
Prove Lagrange's theorem:
|
|
|
|
$$
|
|
a^p = a \text{ (mod p)}
|
|
$$
|
|
|
|
For positive integers $a, p$
|
|
|
|
\vfill
|
|
|
|
\problem{}
|
|
Let $a$ and $m$ be integers so that $a < m$. \\
|
|
Show that $a$ has an inverse mod $m$ iff $\gcd(a, m) = 1$ \\
|
|
|
|
\begin{solution}
|
|
Assume $a^\star$ is the inverse of $a \pmod{m}$. \\
|
|
Then $a^\star \times a \equiv 1 \pmod{m}$ \\
|
|
|
|
Therefore, $aa^\star - 1 = km$, and $aa^\star - km = 1$ \\
|
|
We know that $\gcd(a, m)$ divides $a$ and $m$, therefore $\gcd(a, m)$ must divide $1$. \\
|
|
$\gcd(a, m) = 1$ \\
|
|
|
|
Now, assume $\gcd(a, m) = 1$. \\
|
|
By the Extended Euclidean Algorithm, we can find $(u, v)$ that satisfy $au+mv=1$ \\
|
|
So, $au-1 = mv$. \\
|
|
$m$ divides $au-1$, so $au \equiv 1 \pmod{m}$ \\
|
|
$u$ is $a^\star$.
|
|
\end{solution}
|
|
|
|
\vfill
|
|
|
|
|
|
\problem{}
|
|
Show that for any integers $a, b, c$, \\
|
|
$\gcd(ac + b, a) = \gcd(a, b)$\\
|
|
|
|
\vfill |