\documentclass[11pt]{article}
\usepackage[margin=1in]{geometry}
\setlength{\parindent}{0pt}
\setlength{\parskip}{4pt}

\usepackage[usenames,dvipsnames]{color}
\usepackage{listings}
\lstset{
    language=python,
    basicstyle=\tt\small,
    commentstyle=\color{Green},
    keywordstyle=\color{blue},
    stringstyle=\color{Orange},
    keepspaces=true,
    showstringspaces=false,
    emphstyle=\color{Maroon},
    emph={__name__}
}

\begin{document}

\large
CS 228, HW \#6 \hfill Due: 10/18/2013
\begin{center}
\textbf{Name:} your name here
\par
\textbf{e-ID:} your e-ID here
\end{center}
\hrule
\normalsize

\bigskip
Unless otherwise specified, the exercises listed below are from the textbook \emph{Discrete Mathematics and Its Applications, 7th Ed.}, by Kenneth H.~Rosen. \textbf{Please show all of your work and explain your reasoning; don't just give the final answer.} Submit your \texttt{hw6.tex} and \texttt{hw6.pdf} files via Canvas before 9:00 AM on the due date. As a reminder, late work will NOT be accepted.

\section*{Section 9.1 (page 581)}

\subsection*{Exercise 4: a, b, d}

\subsection*{Exercise 32}

\subsection*{Exercise 34: a, c, e}

\section*{Python Exercises}

\textit{Complete the four Python functions defined below, which represent properties of relations (refer to Pages 576--578). The parameter M is a zero-one matrix representing a relation on a finite set, and is implemented in Python using a list of lists of integers. \textbf{Your implementation must not modify the contents of M.}}

\subsection*{Reflexive, symmetric}

\begin{lstlisting}
def reflexive(M):
    """Returns True if the relation M is reflexive, False otherwise."""
    return False

def symmetric(M):
    """Returns True if the relation M is symmetric, False otherwise."""
    return False
\end{lstlisting}

\subsection*{Transitive property}

\begin{lstlisting}
def transitive(M):
    """Returns True if the relation M is transitive, False otherwise."""
    return False
\end{lstlisting}

\subsection*{Warshall algorithm}

\begin{lstlisting}
def warshall(M):
    """Returns the transitive closure of the relation M (see page 606)."""
    return M
\end{lstlisting}

\section*{Section 9.3 (page 596)}

\subsection*{Exercise 10: a, b, c}

\subsection*{Exercise 12}

\subsection*{Exercise 34}

\section*{Section 9.4 (page 606)}

\subsection*{Exercises 4, 8}

\subsection*{Exercise 20: a, b, c}

\end{document}
