\documentclass[10pt,addpoints]{exam}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{pgfplots}
\usepackage{tikz}
\usepackage{mathtools}
\pagestyle{head}
\usepackage{enumerate}

\newcommand\bigangle[2][]{% 
    \draw[->,domain=0:#2,variable=\t,samples=200,>=latex,#1]
      plot ({0.4*(0.3*\t+#2)*cos(\t)/(#2)},
           {0.4*(0.3*\t+#2)*sin(\t)/(#2)})
        ;}
        
%\headrule
%\header{MATH 11}{Exam 1}{Fall 2016}
\begin{document}
\begin{coverpages}
\begin{center}\huge MATH 4590 - EXAM 1 - SPRING 2018\\
SOLUTION
\end{center}
\begin{flushleft}\vspace{0.5in}
16 February 2018 \\
Instructor: Tom Cuchta
\end{flushleft}
\textbf{Instructions:}
\begin{itemize}
	\item  Show all work, clearly and in order, if you want to get full
	credit. If you claim something is true \textbf{you must show work backing up your claim}. I reserve the right to take off points if I cannot see how you arrived at your answer (even if your final answer is correct).
	\item Justify your answers algebraically whenever possible to ensure full credit. 	
	\item  Circle or otherwise indicate your final answers.
	\item  Please keep your written answers brief; be clear and to the point.
	\item  Good luck!
\end{itemize}
\vspace*{10pt}
\end{coverpages}

\begin{questions}
\question[12] Write the definition.
\begin{parts}
\part[4] Let $M$ be a set and let $d \colon M \times M \rightarrow [0,\infty)$ be a function. Define what it means for the ordered pair $(M,d)$ to be a metric space. \\
\textit{Solution}: It means that the function $d$ satisfies three axioms: \\
\begin{enumerate}
\item (Positive definite) $d(x,y) \geq 0$ and $d(x,y)=0$ if and only if $x=y$,
\item (Symmetry) for all $x, y \in M$, $d(x,y)=d(y,x)$, and
\item (Triangle inequality) for all $x,y,z \in M$, $d(x,y) \leq d(x,z) + d(z,y)$.
\end{enumerate}
\part[4] Let $(M,d_1)$ and $(N,d_2)$ be metric spaces. Define what it means for $f \colon M \rightarrow N$ to be a continuous function. \\
\textit{Solution}: It means $\forall \epsilon > 0 \forall p \in M \exists \delta >0$ such that if $q \in M$ and $d_1(p,q)<\delta$, then $d_2(f(p),f(q))<\epsilon$. 
\part[4] Let $(M,d)$ be a metric space, let $p \in M$, and let $(p_n)$ be a sequence in $M$.  Define what it means for $p_n$ to converge to $p$, i.e. $p_n \rightarrow p$.  \\
\textit{Solution}: It means $\forall \epsilon > 0 \exists N \in \mathbb{N}$ such that if $n \geq N$, then $d(p_n,p)<\epsilon$. 
\end{parts}

\question[17] Prove that the sequence $a_n = \dfrac{5n-12}{2n+1}$ in the metric space $(\mathbb{R},d)$, where $d(x,y)=|x-y|$, converges to the number $\dfrac{5}{2}$.  \\
\textit{Proof}: Let $\epsilon > 0$ and choose $N \in \mathbb{N}$ with $N > \dfrac{\frac{29}{\epsilon}-2}{4}$. Let $n \geq N$, then $4n > \dfrac{29}{\epsilon}-2$ and so $\dfrac{4n+2}{29} > \dfrac{1}{\epsilon}$, hence $\dfrac{29}{4n+2} < \epsilon$. Now compute
\[ \begin{array}{ll}
\left| \dfrac{5n-12}{2n+1} - \dfrac{5}{2} \right| &= \left| \dfrac{(10n-24) - (10n+5)}{4n+2} \right| \\
&= \left| \dfrac{-29}{4n+2} \right| \\
&= \dfrac{29}{4n+2} \\
&< \epsilon,
\end{array} \]
completing the proof. $\blacksquare$

\question[17] Let $(M,d_1)=(N,d_2)=(\mathbb{R},d)$, where $d(x,y)=|x-y|$. Prove that the function $f \colon M \rightarrow N$ defined by $f(x)=3x^2+5x-1$ is a continuous function. \\
\textit{Proof}: Let $\epsilon > 0$, let $p \in M$, and choose $0 < \delta < \min \left\{ \dfrac{\epsilon}{3+|6p+5|},1 \right\}$. Let $q \in M$ such that $d_1(p,q)=|p-q|<\delta$. Compute
\[ \begin{array}{ll}
d_2(f(p),f(q)) &= |f(p)-f(q)| \\
&= |(3p^2+5p-1) - (3q^2+5q-1)| \\
&=|3(p^2-q^2) + 5(p-q)| \\
&=|p-q| |3(p+q)+5| \\
&=|p-q| |3(q-p+2p)+5| \\
&=|p-q||3(q-p)+(6p+5)| \\
&\hspace*{-20pt}\stackrel{\Delta-\text{inequality}}{\leq} |p-q|(3|q-p| + |6p+5|) \\
&< \delta (3\delta + |6p+5|) \\
&\hspace*{-3pt}\stackrel{\delta<1}{<} \delta (3+|6p+5|) \\
&\hspace*{-17pt}\stackrel{\delta<\frac{\epsilon}{3+|6p+5|}}{<} \dfrac{\epsilon}{3+|6p+5|} (3+|6p+5|) \\
&= \epsilon,
\end{array} \]
completing the proof. $\blacksquare$
\vfill

\newpage
\question[17] Let $M=\{A,B,C\}$ and define the function $d \colon M \times M \rightarrow [0,\infty)$ by the following table of values:
\begin{center}\begin{tabular}{|l|l|l|}
\hline
$x$&$y$&$d(x,y)$ \\
\hline 
$A$ & $A$ & $0$ \\
$A$ & $B$ & $50$ \\
$A$ & $C$ & $3$ \\
$B$ & $A$ & $50$ \\
$B$ & $B$ & 0 \\
$B$ & $C$ & $4$ \\
$C$ & $A$ & $3$ \\
$C$ & $B$ & $4$ \\
$C$ & $C$ & 0 \\
\hline
\end{tabular}\end{center}
Which axioms of a metric space does the structure $(M,d)$ satisfy? Is this structure a metric space? \\
\textit{Solution}: It satisfies two of the three. This function satisfies the positive definite property because all of its outputs are nonnegative and $d(x,y)=0$ if and only if $x=y$. The function is symmetric because it is always the case that $d(x,y)=d(y,x)$. However, this function does not satisfy the triangle inequality because
\[\underbrace{d(A,B)}_{=50} \not< \underbrace{d(A,C) + d(C,B)}_{=7} \]

\question[17] Associate each metric to its unit circle. The ``unit circle" in the metric space $(\mathbb{R}^2,d)$ is the set of points $(x,y)$ whose distance from $(0,0)$ is $1$, i.e.
\[\text{unit circle}= \{(x,y) \in \mathbb{R}^2 \colon d((x,y),(0,0))=1.\]

a.) 	\begin{tikzpicture}
        \draw[thick] (0cm,0cm) circle(1cm);
        \draw (0,-1.5) -- (0,1.5);
        \draw (-1.5,0) -- (1.5,0);
		\end{tikzpicture}		
b.) 	\begin{tikzpicture}
		\draw [fill=gray,gray] (-1.5,1.5) rectangle (1.5,-1.5); 
        \draw (0,-1.5) -- (0,1.5);
        \draw (-1.5,0) -- (1.5,0);
        \draw[thick,fill=white,opacity=1] (0cm,0cm) circle(0.1cm);
		\end{tikzpicture}
c.) 	\begin{tikzpicture}
		\draw [black] (-1,1) rectangle (1,-1); 		
        \draw (0,-1.5) -- (0,1.5);
        \draw (-1.5,0) -- (1.5,0);		
		\end{tikzpicture}
d.) 	\begin{tikzpicture}
		\draw (0,1) -- (-1,0) -- (0,-1) -- (1,0) -- (0,1);
        \draw (0,-1.5) -- (0,1.5);
        \draw (-1.5,0) -- (1.5,0);		
		\end{tikzpicture}

\begin{minipage}{0.5\textwidth}
i.) The ``discrete" metric: \\ 
$d(x,y) = \left\{ \begin{array}{ll} 
1 &, \quad x \neq y \\
0 &, \quad x=y
\end{array} \right.$

ii.) The ``Euclidean" metric: \\
$d((x_1,y_1),(x_2,y_2)) = \sqrt{(x_1-x_2)^2+(y_1-y_2)^2}$
\end{minipage}
\begin{minipage}{0.5\textwidth}
iii.) The ``taxicab" metric: \\
$d((x_1,y_1),(x_2,y_2)) = |x_1-x_2| + |y_1-y_2|$

iv.) The ``maximum" metric: \\
$d((x_1,y_1),(x_2,y_2)) = \mathrm{max}\{|x_1-x_2|,|y_1-y_2|\}$
\end{minipage} \\
\textit{Solution}: i.) and b.) go together: this is because all points are exactly a distance $1$ away from $(0,0)$ except for $(0,0)$ itself! \\
ii.) and a.) go together: this is the ``usual" metric and the ``usual" circle \\
iii.) and d.) go together: since I'm adding coordinates, points like $\left(\dfrac{1}{2},\dfrac{1}{2}\right)$ in quadrant I are on the unit circle, because in this metric
\[d((0,0),(\frac{1}{2},\frac{1}{2}))=\dfrac{1}{2}+\dfrac{1}{2}=1.\] \\
iv.) and c.) go together: in this metric we are taking the maximum of the difference in the coordinates. Therefore the unit circle consists of points which have the property that at least one of their coordinates is exactly equal to 1 (and none are larger than 1). \\
\newpage
\question[20] Let $(M,d_1)$ and $(N,d_2)$ be metric spaces with $(N,d_2)=(\mathbb{R},d_2)$, where $d_2(x,y)=|x-y|$. Furthermore, let $f \colon M \rightarrow N$ be a continuous function. Prove that the function $g \colon M \rightarrow N$ defined by $g(x)=|f(x)|$ is a continuous function. \\
(\textit{hint: recall the reverse triangle inequality:
$||a|-|b|| \leq |a-b|$}) \\
\textit{Proof}: Let $\epsilon > 0$, let $p \in M$. Since $f$ is continuous, there exists a $\delta_f > 0$ such that whenever $q \in M$ with $d_1(p,q)<\delta_f$, it follows that $d_2(f(p),f(q))=|f(p)-f(q)|<\epsilon$. Choose $0<\delta < \delta_f$ and let $q \in M$ with $d_1(p,q) < \delta$. Calculate
\[ \begin{array}{ll}
d_2(g(p),g(q)) &= |g(p)-g(q)| \\
&= ||f(p)|-|f(q)|| \\
&\hspace*{-28pt}\stackrel{\text{reverse}-\Delta\text{ inequality}}{\leq} |f(p)-f(q)| \\
&\stackrel{\delta<\delta_f}{<} \epsilon,
\end{array} \]
completing the proof. $\blacksquare$
\question[5] (\textbf{Bonus}) Let $(M,d_1)=(N,d_2)=(\mathbb{R},d)$, where $d(x,y)=|x-y|$. Let $f \colon M \rightarrow N$ and $g \colon M \rightarrow N$ be continuous functions. Prove that the function $h \colon M \rightarrow N$ defined by $h(x)=f(x)g(x)$ is continuous. \\
\textit{Proof}: Let $\epsilon > 0$ and let $p \in M$. Since $f$ is continuous, there exists a $\delta_f > 0$ such that if $q \in M$ with $|p-q|<\delta_f$, it follows that $|f(p)-f(q)|<\dfrac{\epsilon}{2(|g(p)|+\epsilon)}$. Similarly, since $g$ is continuous, there exists a $\delta_g>0$ such that if $q \in M$ with $|p-q|<\delta_g$, it follows that $|g(p)-g(q)|<\min \left\{ \dfrac{\epsilon}{2|f(p)|}, \dfrac{\epsilon}{2} \right\}$. 

Choose $0<\delta<\min \{ \delta_f, \delta_g \}$ and let $q \in M$ with $|p-q|<\delta$. Compute
\[ \begin{array}{ll}
|h(p)-h(q)| &= |f(p)g(p)-f(q)g(q)| \\
&= |f(p)g(p) - f(q)g(q) \underbrace{+ f(p)g(q) - f(p)g(q)}_{\text{add zero}}| \\
&= |[f(p)g(p) - f(p)g(q)] + [f(p)g(q)-f(q)g(q)]| \\
&\hspace*{-20pt}\stackrel{\Delta-\text{inequality}}{\leq} |f(p)g(p)-f(p)g(q)| + |f(p)g(q)-f(q)g(q)| \\
&= |f(p)| |g(p)-g(q)| + |g(q)| |f(p)-f(q)| \\
&= |f(p)| |g(p)-g(q)| + |g(q)\underbrace{-g(p)+g(p)}_{\text{add zero}}| |f(p)-f(q)| \\
&\hspace*{-15pt}\stackrel{\Delta-\text{inequality}}{=} |f(p)| |g(p)-g(q)| + \Big[|g(q)-g(p)|+|g(p)| \Big] |f(p)-f(q)| \\
&\hspace*{-5pt}\stackrel{\delta<\delta_g}{<} |f(p)| \underbrace{\left(\dfrac{\epsilon}{2|f(p)|} \right)}_{|g(p)-g(q)|<\frac{\epsilon}{2|f(p)|}} + \underbrace{[\epsilon + |g(p)|]}_{|g(p)-g(q)|<\epsilon} |f(p)-f(q)| \\
&= \dfrac{\epsilon}{2} + [\epsilon + |g(p)|] |f(p)-f(q)|\\
&\hspace*{-5pt}\stackrel{\delta<\delta_f}{<} \dfrac{\epsilon}{2} + [\epsilon + |g(p)|] \left( \dfrac{\epsilon}{2(|g(p)|+\epsilon} \right) \\
& = \dfrac{\epsilon}{2} + \dfrac{\epsilon}{2} \\
& = \epsilon,
\end{array} \]
completing the proof. $\blacksquare$
\vfill
\end{questions}
\end{document}