\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 7}                  
\newcommand{\probs}{Pages 182--183: 2 bcghjlq}          
\newcommand{\duedate}{Nov.\ 4, 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} 
\usepackage{tikz} 
\usetikzlibrary{automata,positioning} 
%-----------------------------------------------------------------

% 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}}
%-----------------------------------------------------------------


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

\renewcommand{\qedsymbol}{}  % Suppress "end-of-proof" symbol
                             % throughout proof environments

\begin{exercise}{2}
For each of the following languages $L$, state whether $L$ is regular
or not and prove your answer.  If a language is regular, you can prove
this by constructing a DFA, an NFA, or a regular expression --- or
give a convincing argument that one of these must exist. If the
language is not regular, give an argument based on the pumping theorem
for regular languages.
\begin{enumerate}[(a)]
\item[b)] $\{a^ib^j: 
             i, j \geq 0 \text{ and } i-j=5 \}$.

\item[c)] $\{a^ib^j: 
             i, j \geq 0 \text{ and } |i-j| \equiv_5 0 \}$.

\item[g)] $\{w = xy: 
             x, y \in \{a,b\}^* \text{ and } |x|=|y| \text{ and } \#_a(x) \geq \#_a(y) \}.$

\item[h)] $\{w = xyzy^Rx: 
             x,y,z \in \{a,b\}^* \}$.

\item[j)] $\{w \in \{0,1\}^*:  
             \#_0(w) \neq \#_1(w) \}$.

\item[l)] $\{w \in \{a,b\}^*: 
          \exists x \in \{a,b\}^+ \text{ such that } w = xx^Rx\}$.

\item[q)] $\{w \in \{a, b, \dots, z\}^*: 
          \text{ every letter in $w$ appears at least twice } \}$.\\ 
           For example, \textit{unprosperousness} is in $L$.
\end{enumerate}
\end{exercise}

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

\end{document}
                                    
                                    
                                   
                                  
                                
                                 
                                
                                  
                                 
