\newlec

\hdc

\ic{There are two clicker questions here. Choose the one you prefer. I like the first one because students often forget they can use LDEs to find inverses.}

Let $[x]$ be the inverse of $[241]$ in $\mathbb{Z}_{1001}$, if it exists, where $0 \leq x < 1001$. Determine the sum of the digits of $x$.

\begin{enumerate}[A)]
\item $7$
\item $9$
\item $11$
\item $12$
\item $[x]$ does not exist
\end{enumerate}
\vskip3em

\soln We use the Extended Euclidean Algorithm (EEA) on $241x + 1001y = 1$  to see that

\begin{table}[ht!]
%\caption{default}
\begin{center}
\begin{tabular}{|c|c|c|c|}
\hline
$x$ & $y$ & $r$ & $q$ \\
\hline
0 & 1 & 1001 & 0 \\
1 & 0 & 241 & 0\\
-4 & 1 & 37 & $\floor{\tfrac{1001}{241}}=4$\\
25 & -6 & 19 & $\floor{\tfrac{241}{37}} = 6$\\
-29 & 7 & 18 & $\floor{\tfrac{37}{19}}=1$\\
54 & -13 & 1 & $\floor{\tfrac{19}{18}} = 1$\\
\hline
\end{tabular}
\end{center}
%\label{default}
\end{table}%

Hence $241(54) + 1001(-13) = 1$ and so $[54]$ is the inverse of $[241]$ in $\mathbb{Z}_{1001}$. Since $5+4=9$, the correct answer is B.

\newpage

\hdc

How many integers $x$ satisfy all of the following three conditions?

\begin{gather*}
 x \equiv 6 \pmod{13} \\
 4x \equiv 3 \pmod{7} \\
  -1000 < x < 1000 
 \end{gather*}
 
\begin{enumerate}[A)]
\item $1$
\item $7$
\item $13$
\item $22$
\item $91$
\end{enumerate}
\vskip3em

\soln
Note that multiplying $ 4x \equiv 3 \pmod{7}$ by $2$ gives $x \equiv 6 \mod{7}$. By the Chinese Remainder Theorem or by Splitting the Modulus, we see that $x \equiv 6 \mod{91}$. Thus, $x = 6 + 91k$. Using this with the range restriction gives
\begin{align*}
-1000 &< 6 + 91k < 1000\\
-1006 &< 91k < 994
\end{align*}
Note that $91\cdot10 = 910$ and $91 \cdot 11 = 1001$. Therefore, the above condition with the fact that $k \in \mathbb{Z}$ reduces to $-11 \leq k \leq 10$ and thus, there are 22 solutions.

\ic{This is the 10 minute mark; this is a longer problem}

\newpage

\defn The modulus of $z = x + yi$ is the nonnegative real number 
\[
|z| = |x + yi| := \sqrt{x^{2} + y^{2}}
\]
\prop (Properties of Modulus (PM))
\begin{enumerate}
\item $|\overline{z}| = |z|$
\item $z\overline{z} = |z|^{2}$
\item $|z| = 0 \Leftrightarrow z=0$
\item $|zw| = |z||w|$
\item $|z + w| \leq |z| + |w|$ (This is called the triangle inequality)
\end{enumerate}
\ic{Mention that properties 3,4,5 define a norm. I recommend not doing the proof of all of these. I would do 2,4 and 5. In fact, I would make 5 an in-class reading proof to get some reading practice in.}
\pf Throughout, let $z = x + yi$. 
\begin{enumerate}
\item Note that
\begin{align*}
|\overline{z}| = |x - yi| = \sqrt{x^{2} + (-y)^{2}} = \sqrt{x^{2} + y^{2}} = |z|
\end{align*}
\item $z\overline{z} = (x+yi)(x-yi) = x^{2} + y^{2} = |z|^{2}$
\item $|z| = 0$ if and only if $\sqrt{x^{2} + y^{2}} = 0$ if and only if $x^{2} + y^{2} = 0$ if and only if $x=y=0$ if and only if $z=0$. 
\item Using the second property above and Properties of Conjugates, we have
\begin{align*}
|zw|^{2} &= (zw)\overline{zw} =z\overline{z}w\overline{w} = |z|^{2}|w|^{2}
\end{align*}
Hence, since all the numbers above are real, we have that $|zw| = |z||w|$.
\item (See the handout on next page)
\end{enumerate}
\newpage
\hdc

To prove $|z + w| \leq |z| + |w|$, it suffices to prove that
$$|z+w|^{2} \leq (|z| + |w|)^{2} = |z|^{2}  + 2|zw| + |w|^{2}$$
since the modulus is a positive real number. Using the Properties of Modulus and the Properties of Conjugates, we have
\begin{align*}
|z+w|^{2} &= (z+w)(\overline{z+w})  && \text{PM}  \\
&= (z+w)(\bar{z} + \bar{w}) && \text{PCJ}   \\
&= z\bar{z} + z\bar{w} + w\bar{z} + w\bar{w} \\ 
&= |z|^{2} + z\bar{w} + \overline{z\bar{w}} + |w|^{2} && \text{PCJ and PM}
\end{align*}
Now, from Properties of Conjugates, we have that 
$$z\bar{w} + \overline{z\bar{w}} = 2\Re(z\bar{w}) \leq 2|z\bar{w}| = 2|zw|$$
and hence
\begin{align*}
|z+w|^{2} = |z|^{2} + z\bar{w} + \overline{z\bar{w}} + |w|^{2} \leq |z|^{2} + 2|zw| + |w|^{2}
\end{align*}
completing the proof.

\begin{center}
\includegraphics{TriangleInequality.png}
\end{center}
\vskip3em

\newpage
\ic{This is the 25-30 minute mark}
\textbf{Revisit Inverses}
\vskip1em
Recall, we defined the inverse of $z$ by
\[
z^{-1} = \frac{x}{x^{2} + y^{2}} - \frac{y}{x^{2} + y^{2}}i
\]
Note that
\[
z^{-1} = \frac{1}{z} \cdot \frac{\overline{z}}{\overline{z}} = \frac{\overline{z}}{z\cdot \overline{z}} = \frac{\overline{z}}{|z|^{2}}
\]
\textbf{Argand Diagram}
\begin{center}
\includegraphics[scale=0.5]{ArgandDiagram.png}
\end{center}
\ic{This is the 35 minute mark.}
\textbf{Polar Coordinates}
\vskip1em
A point in the plane corresponds to a length and an angle:
\begin{center}
\includegraphics{PlaneAngle.png}
\end{center}
\ex $(r,\theta) = (3, \tfrac{\pi}{4})$ corresponds to 
\begin{align*}
3\cos(\pi/4) + i(3\sin(\pi/4)) = \frac{3}{\sqrt{2}} + \frac{3}{\sqrt{2}}i
\end{align*}
via the picture
\begin{center}
\includegraphics{PlaneAngleEx1.png}
\end{center}
Given $z = x + yi$, we see that
\begin{gather*}
r = |z| = \sqrt{x^{2} + y^{2}}\\
\theta = \arccos(x/r) = \arcsin(y/r) = \arctan(y/x)
\end{gather*}
\begin{center}
\includegraphics{PlaneAngleEx2.png}
\end{center}
\note WARNING. The angle $\theta$ might be $\arctan(y/x)$ OR $\pi + \arctan(y/x)$ depending on which quadrant we are in. More on this next class.
\vskip1em
\ex Write $z = \sqrt{6} + \sqrt{2}i$ using polar coordinates.
\vskip1em
\soln Note that $r = \sqrt{\sqrt{6}^{2} + \sqrt{2}^{2}} = \sqrt{8} = 2\sqrt{2}$. Further,
\[
\arctan(\sqrt{2}/\sqrt{6}) = \arctan{1/\sqrt{3}} = \pi/6
\]
\note There is no need to add $\pi$ to the above answer since the answer lies in the first quadrant.
\begin{center}
\includegraphics{PlaneAngleEx3.png}
\end{center}
Therefore, $z$ corresponds to $(r,\theta) = (2\sqrt{2}, \pi/6)$. \qed
\vskip1em
\defn The polar form of a complex number $z$ is $z = r(\cos(\theta) + i\sin(\theta))$ where $r$ is the modulus of $z$ and $\theta$ is called \textit{an} argument of $z$. This is sometimes denoted by $\arg(z) = \theta$. Further, denote $\cis(\theta) := \cos(\theta) + i\sin(\theta)$.
\vskip1em
\ex If $z = \sqrt{6} + \sqrt{2}i$, then $z = 2\sqrt{2}(\cos(\pi/6) + i\sin(\pi/6)) = 2\sqrt{2} \cis(\pi/6)$.
\ic{This is the 50 minute mark.}
