\documentclass[11pt]{article}
\usepackage{amsmath,amssymb,amsthm,enumerate,verbatim}
%\usepackage[margin=1in]{geometry}
\usepackage{tikz}
\usetikzlibrary{automata,positioning}
\newcommand{\encode}[1]{\langle #1 \rangle}

\title{\vspace{-3ex}\bf Assignment 2 \\[1ex]
\rm\normalsize CS 311, Fall 2015 \\ Due: October 14, 2014}
\date{}
\author{}

\begin{document}
\maketitle

\paragraph{Problem 1} Give state diagrams of DFAs recognizing the following languages.
\begin{enumerate}[a)] \itemsep-2pt
\item $\{w \; |\; w \mbox{ contains the substrings $ab$ and $ba$} \}$, $\Sigma = \{a,b\}$ [5 points]
\item $\{w \; |\; w \mbox{ contains an even number of 0s or exactly three 1s} \}$, $\Sigma = \{0,1\}$ [5 points] 
\item $\{w \; |\; w \mbox{ is a binary multiple of 5} \}$, $\Sigma = \{0,1\}$ [5 points]
\item $\{w \; |\; w = a^nb^n, 0\leq n \leq 3 \}$, $\Sigma = \{a,b,c\}$ [5 points]
\end{enumerate}

\paragraph{Problem 2} Prove or disprove the following: Let $D$ be a DFA with $|Q| = k$. If $|L(D)|$ is finite
    then there exists a string $w$ of length at most $k-1$ such that $w \notin L(D)$.[10 points]

\paragraph{Problem 3} For any string $w=w_1w_2...w_n$, the reverse of $w$, written $w^R$, is the string
$w$ in reverse order, $w_n...w_2w_1$.  For any language $A$, let $A^R = \{w^R \;|\; w \in A\}$.  Show
that if $A$ is regular, so is $A^R$. [10 points]

\begin{comment}
\paragraph{Problem 4} We can define $shortlex$ as a total ordering on strings, where strings are sorted 
    primarily by length and then by lexicographical order.
    Give a regular expression that recognizes all string that fall before the string "structure" in $shortlex$ order.
    Use $\Sigma = \{a,b,c,...,z\}$. (Hint: Expect the answer to be rather long) [10 points]
\end{comment}

\paragraph{Problem 4} Prove that the language:
    \[ \{ w \;|\; w \text{ is a multiple of $k$ represented in binary} \}\]
    is regular for all finite values of $k$.
    (Hint: You need to describe a general construction for all $k$. Consider how your
    DFA from problem 1c relates to bit-shifting) [10 points]

\paragraph{Problem 5} Describe a language $L$ for which there exists an NFA $N$ that has a small number of states
    (think linear on some property of the language), 
    but a DFA $M$ must have a large number of states (think exponential on some property of the language).
    Clearly and carefully justify your answer. [10 points]

\end{document}
