One example of a non-abelian group is the set of invertible 2x2 matrices under matrix multiplication.
\problem{}
Show that if $G$ has four elements, $(G, \ast)$ is abelian.
\vfill
\pagebreak
\problem{}
Prove \ref{mod_has_inverse}: \par
$a$ has an inverse mod $m$ iff $\gcd(a, m)=1$\par
\begin{solution}
Assume $a^\star$ is the inverse of $a \pmod{m}$. \par
Then $a^\star\times a \equiv1\pmod{m}$\par
Therefore, $aa^\star-1= km$, and $aa^\star- km =1$\par
We know that $\gcd(a, m)$ divides $a$ and $m$, therefore $\gcd(a, m)$ must divide $1$. \par
$\gcd(a, m)=1$\par
Now, assume $\gcd(a, m)=1$. \par
By the Extended Euclidean Algorithm, we can find $(u, v)$ that satisfy $au+mv=1$\par
So, $au-1= mv$. \par
$m$ divides $au-1$, so $au \equiv1\pmod{m}$\par
$u$ is $a^\star$.
\end{solution}
\vfill
\problem{}<eua_runtime>
The Euclidean Algorithm (From \ref{euclid}) can be written as follows: \par
\begin{itemize}
\item Assume $a > b$.
\item Set $e_0= a$ and $e_1= b$. \par
\item Let $e_{n+1}=\text{remainder}(r_{n-1}\div r_{n})$\par
\item Stop when $e_{k}=0$.
\item Then, $\gcd(a, b)= e_{k-1}$. \par
\end{itemize}
Let $F_n$ be the $n^{\text{th}}$ Fibonacci number. ($F_0=0$; $F_1=1$; $F_2=1$; $\dots$) \par
\vspace{2mm}
Show that if the Euclidean algorithm requires $n$ steps for an input $(a, b)$, then $a \geq F_{n+2}$ and $b \geq F_{n+1}$.
In other words, show that the longest-running input of a given size is a Fibonacci pair.
\begin{solution}
The easiest way to go about this is induction on $n$: \par
\textcolor{gray}{\textit{Base Case:}}
If $n =1$, $b$ divides $a$ with no remainder, and the smallest possible $a, b$ for which this is true is $(2, 1)=(F_3, F_2)$.
\linehack{}
\textcolor{gray}{\textit{Induction:}}
Assume that for $n$ steps, $a \geq F_{n+2}$ and $b \geq F_{n+1}$.
Now, say the algorithm takes $n+1= m$ steps. \par
The first step gives us $a = q_0b + r_0$\par
Therefore, the pair $(b, r_0)$ must take $m-1$ steps. \par
We thus know that $b \geq F_{m+1}$ and $r_0\geq F_m$\hfill\textcolor{gray}{by our induction hypothesis}\par
Therefore, $a = q_0b + r_0\geq b + r_0$\par
But $b + r_0= F_{m+1}+ F_{m}= F_{m+2}$, \par
so $a \geq F_{m+2}$.
\end{solution}
\vfill
\pagebreak
\problem{Chinese Remainder Theorem}
There are certain things whose number is unknown. If we count them by threes, we have two left over; by fives, we have three left over; and by sevens, two are left over. How many things are there?
\begin{solution}
$x \equiv2\pmod{3}$\par
$x \equiv3\pmod{5}$\par
$x \equiv2\pmod{7}$\par
$x =23+105k\ \forall k \in\mathbb{Z}$
\end{solution}
\vfill
\problem{}<flt_prereq>
Show that if $p$ is prime, $\binom{p}{i}\equiv0\pmod{p}$
for $0 < i < p$.
\begin{solution}
$\binom{p}{i}=\frac{p!}{i!(p-i)!}$ tells us that $i!(p-i)!$ divides $p!= p(p-1)!$. \\
However, $i!(p-i)!$ and $p$ are coprime, since all factors of $i!(p-i)!$ are smaller than $p$. \\
Therefore, $i!(p-i)!$ must divide $(p-1)!$\par
So, $\binom{p}{i}= p \times\frac{(p-1)!}{i!(p-i)!}$, and $\binom{p}{i}\equiv0\pmod{p}$.
\end{solution}
\vfill
\pagebreak
\problem{Fermat's Little Theorem}
Show that if $p$ is prime and $a \not\equiv0\pmod{p}$, then $a^{p-1}\equiv1\pmod{p}$. \\
You may want to use \ref{flt_prereq}. \par
\hint{It may be easier to show that $a^p \equiv a \pmod{p}$}
\begin{solution}
Use induction:
$1\equiv1\pmod{p}$\par
Using \ref{flt_prereq} and the binomial theorem, we have