\documentclass[letterpaper,addpoints,11pt]{exam}
\usepackage[top=.75in,left=.7in,right=1in,bottom=.75in]{geometry}

\usepackage{graphicx}
\usepackage{enumerate}
\usepackage{amsmath}
\usepackage{amssymb}

%%KEY%%
%\printanswers

\checkboxchar{$\Box$}


%-----------------------------------
\begin{document}
%-----------------------------------
\begin{center}

{\huge Clustering Activity} \\
\end{center}


The questions below will refer the to the following pairwise distance matrix:

\begin{center}

  \begin{tabular}{lllllllll}
                       & A                         & B                         & C                         & D                         & E                         & F                         & G                         & H                         \\ \cline{2-9} 
\multicolumn{1}{l|}{A} & \multicolumn{1}{l|}{0.0}  & \multicolumn{1}{l|}{15.5} & \multicolumn{1}{l|}{12.8} & \multicolumn{1}{l|}{10.6} & \multicolumn{1}{l|}{14.1} & \multicolumn{1}{l|}{2.1}  & \multicolumn{1}{l|}{13.3} & \multicolumn{1}{l|}{1.0}  \\ \cline{2-9} 
\multicolumn{1}{l|}{B} & \multicolumn{1}{l|}{15.5} & \multicolumn{1}{l|}{0.0}  & \multicolumn{1}{l|}{5.3}  & \multicolumn{1}{l|}{4.9}  & \multicolumn{1}{l|}{2.4}  & \multicolumn{1}{l|}{16.5} & \multicolumn{1}{l|}{15.8} & \multicolumn{1}{l|}{14.6} \\ \cline{2-9} 
\multicolumn{1}{l|}{C} & \multicolumn{1}{l|}{12.8} & \multicolumn{1}{l|}{5.3}  & \multicolumn{1}{l|}{0.0}  & \multicolumn{1}{l|}{4.3}  & \multicolumn{1}{l|}{6.2}  & \multicolumn{1}{l|}{13.2} & \multicolumn{1}{l|}{10.6} & \multicolumn{1}{l|}{11.8} \\ \cline{2-9} 
\multicolumn{1}{l|}{D} & \multicolumn{1}{l|}{10.6} & \multicolumn{1}{l|}{4.9}  & \multicolumn{1}{l|}{4.3}  & \multicolumn{1}{l|}{0.0}  & \multicolumn{1}{l|}{3.8}  & \multicolumn{1}{l|}{11.6} & \multicolumn{1}{l|}{13.2} & \multicolumn{1}{l|}{9.7}  \\ \cline{2-9} 
\multicolumn{1}{l|}{E} & \multicolumn{1}{l|}{14.1} & \multicolumn{1}{l|}{2.4}  & \multicolumn{1}{l|}{6.2}  & \multicolumn{1}{l|}{3.8}  & \multicolumn{1}{l|}{0.0}  & \multicolumn{1}{l|}{15.3} & \multicolumn{1}{l|}{16.4} & \multicolumn{1}{l|}{13.2} \\ \cline{2-9} 
\multicolumn{1}{l|}{F} & \multicolumn{1}{l|}{2.1}  & \multicolumn{1}{l|}{16.5} & \multicolumn{1}{l|}{13.2} & \multicolumn{1}{l|}{11.6} & \multicolumn{1}{l|}{15.3} & \multicolumn{1}{l|}{0.0}  & \multicolumn{1}{l|}{12.0} & \multicolumn{1}{l|}{2.3}  \\ \cline{2-9} 
\multicolumn{1}{l|}{G} & \multicolumn{1}{l|}{13.3} & \multicolumn{1}{l|}{15.8} & \multicolumn{1}{l|}{10.6} & \multicolumn{1}{l|}{13.2} & \multicolumn{1}{l|}{16.4} & \multicolumn{1}{l|}{12.0} & \multicolumn{1}{l|}{0.0}  & \multicolumn{1}{l|}{12.6} \\ \cline{2-9} 
\multicolumn{1}{l|}{H} & \multicolumn{1}{l|}{1.0}  & \multicolumn{1}{l|}{14.6} & \multicolumn{1}{l|}{11.8} & \multicolumn{1}{l|}{9.7}  & \multicolumn{1}{l|}{13.2} & \multicolumn{1}{l|}{2.3}  & \multicolumn{1}{l|}{12.6} & \multicolumn{1}{l|}{0.0}  \\ \cline{2-9} 
\end{tabular}


\end{center}


\begin{questions}
  
\question \textbf{Agglomerative Hierarchical Clustering}
  
Show the dendrogram that results from performing single-link
agglomerative hierarchical clustering on the data above. (In
\emph{single-link} hierarchical clustering the distance between two
clusters is based on minimum distance between any two points in those
clusters.)

\begin{solution}[2.5in]
\end{solution}

\question \textbf{DBSCAN}

Answer the following questions, assuming that the DBSCAN clustering algorithm has been executed with $Eps=5$, $MinPts=3$.

\begin{parts}
  \part
  Which points are \emph{core points}?
  \begin{solution}[.5in]
  \end{solution}

  \part
  Which points are \emph{border points}?
  \begin{solution}[.5in]
  \end{solution}
  
  \part
  Which points are \emph{noise points}?
  \begin{solution}[.5in]
  \end{solution}

  
  \part
  How many clusters are there, and which points belong to which
  clusters?
  \begin{solution}[.5in]
  \end{solution}

 \end{parts}


\newpage

\question \textbf{Working with Distance Matrices}

Which of the following algorithms can we perform using only the
distance matrix above, without having access to the original data
points?

\begin{parts}
  \part Principal Components Analysis
  \part Multidimensional Scaling
  \part Isomap
  \part K-Means Clustering
\end{parts}

\vspace{.5in}
\question \textbf{K-Means vs. DBSCAN}

For each pair of clusterings below, determine which was performed by
K-Means and which was performed by DBSCAN.  Where the clustering
results seem less than ideal, consider how you might modify the
parameters of the algorithm to improve the outcome.

\begin{center}
  \includegraphics{cluster_demo.pdf}
\end{center}

\end{questions}

\end{document}
