\documentclass[11pt]{article}

% Define some commands for names to be used in this document
%-----------------------------------------------------------------
\newcommand{\myname}{Joe College}             % ADJUST THESE
\newcommand{\course}{MAT 4885}                % AS NECESSARY...
\newcommand{\assignment}{Homework 2}                  
\newcommand{\probs}{Page 122: 2abfghjln}          
\newcommand{\duedate}{Sept.\ 9, 2011}              
%-----------------------------------------------------------------

% Declare some LaTeX packages for this document
%-----------------------------------------------------------------
\usepackage{amsmath}            % AMS enhancements for mathematical formulas
\usepackage{amsthm}             %     ... for theorem environments
\usepackage{amssymb,latexsym}   %     ... for additional mathematical symbols
\usepackage{graphicx}           % For graphics inclusion (e.g., PDF files)
\usepackage{verbatim}           % Useful for including code snippets
\usepackage{enumerate}          % Makes enumerated lists simpler to control
\usepackage[left=1in,right=1in,top=0.75in,bottom=0.5in]{geometry} % sets margins
\usepackage[dvipsnames,usenames]{color}    % Colors!  
\usepackage{ifthen} 
%-----------------------------------------------------------------

% Define the desired format for the title to appear on the first page
%-----------------------------------------------------------------
\newcommand{\mytitle}{
\begin{flushleft}
\bfseries
\assignment       \hspace*{\fill} \course \hspace*{\fill} \myname\\
\probs    \hspace*{\fill}                                 \duedate\\
\rule[10pt]{\linewidth}{1pt}
\end{flushleft}
}
%-----------------------------------------------------------------

% Define the desired page headings for all pages except the first
%-----------------------------------------------------------------
\pagestyle{myheadings}
\markright{\course{} \assignment: \myname}
%-----------------------------------------------------------------
 
% Define an exercise environment, with two parameters:
%   -- how to refer to it: Exercise, Problem, etc. (optional) 
%   -- the exercise number
%-----------------------------------------------------------------
\newenvironment{exercise}[2][Exercise]
 {\begin{trivlist}\item[\hspace{0pt} \textbf{#1}~\textbf{#2.}]}
 {\end{trivlist}}
%-----------------------------------------------------------------

% Define a command to check for the existence of the student name
%-----------------------------------------------------------------
\newcommand{\checkname}
{
\ifthenelse{\equal{\myname}{Joe College}}
{
  \vspace*{\fill}
  \begin{center}
    {\LARGE \bf Your name is {\color{BrickRed} \myname}?\\[3pt]
    Please change \texttt{\color{BrickRed} \textbackslash myname} and re-process.}
  \end{center}
  \vspace*{\fill}
  \end{document}
  \newpage
}
{}
}

%
% Document body begins here...
%-----------------------------------------------------------------
\begin{document}
\thispagestyle{empty}   % No page headings for page 1...
\mytitle                % Instead, put the customized title on this page
\checkname

\renewcommand{\qedsymbol}{}  % Suppress "end-of-proof" symbol
                             % throughout proof environments
\begin{exercise}{2}
Design deterministic finite state automata which accept each of the
following languages. Implement and test your designs with JFLAP and
provide explanations of each automaton. 
\begin{enumerate}[a)]
\item[a)] $\{ w \in \{a,b\}^* : \text{ every $a$ in $w$ is immediately
    preceded and followed by $b$}\}$.

\item[b)] $\{ w \in \{a,b\}^* : \text{ $w$ does not end in $ba$} \}$.

\item[f)] $\{ w \in \{0,1\}^* : \text{ $w$ has $001$ as substring} \}$.

\item[g)] $\{ w \in \{0,1\}^* : \text{ $w$ does not have $001$ as substring} \}$.

\item[h)] $\{ w \in \{a,b\}^* : \text{$w$ has $bbab$ as substring} \}$.
         
\item[j)] $\{ w \in \{a,b\}^* : \text{$w$ has both $aa$ and $bb$ as substrings} \}$.
         
\item[l)] $\{ w \in \{0,1\}^* : \text{$w$ has no more than one pair of
  consecutive $0$'s and no more than one pair of } \break \text{ consecutive $1$'s} \}$.

\item[n)] $\{ w \in \{a,b\}^* : (\#_a(w) + 2 \cdot \#_b(w) \equiv_5 0)\}$.
          Note: $\#_a(w)$ represents the number of $a$'s in $w$.
\end{enumerate}
\end{exercise}

\begin{proof}[Solution]
  % Your solution...
\end{proof}

\end{document}
                                    
                                    
                                   
                                  
                                
                                 
                                
                                  
                                 

