%&latex
\documentclass[12pt]{article}
\usepackage{fullpage-old} \usepackage{fancyhdr}
\usepackage{amsmath}    \usepackage{amsfonts}   \usepackage{amssymb}
\usepackage{graphics}   \usepackage{epsfig}     \usepackage{wrapfig}
\usepackage{enumitem}

\lhead{} \cfoot[]{Page \thepage{}}%{ of 1}
\pagestyle{fancy} \renewcommand{\headrulewidth}{0pt}
\fancypagestyle{plain}{ \renewcommand{\headrulewidth}{0pt} }
\parskip 1ex
\parindent 0mm

\newcommand*{\ii}[1]{\textit{#1\/}}
\def\mi{\mathit}
\def\ttt{\texttt}
\def\ss{\hspace{1pt}}

% Logical operators
\def\andl{\wedge}
\def\orl{\vee}
\def\xorl{\oplus}
\def\notl{\neg}


\begin{document}

%{\flushright Name: \rule{15em}{0.25pt} \par} 
\vspace{-2ex}
{\center \Large FLAC Assignment 3\par}
\vspace{2ex}

%\begin{wrapfigure}{r}{3.3in}
%\vspace{-3ex}
%\includegraphics[scale=1.2]{hw2-fig.pdf}
%\end{wrapfigure}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{Exercise 1} For each of the following regular expressions, construct a DFA that recognizes it. 
\begin{enumerate}
\item $((0\cup1)^*0)^*$
\item $(1010\cup0101\cup10\cup01)^*$
\item $0 \cup (00\cup000)^*$
\end{enumerate}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{Exercise 2 }   We write each natural number\footnote{Zero is a natural number
} in its binary representation;
e.g., ``5" is represented as 101 and ``9" is represented as 1001. Give a regular expression for the following language: \[ L = \{x \ |\ x \text{ is the binary representation of  some natural number 
divisible by 3\}. }
\] 


\paragraph{Exercise 3. DFA Minimization.}  
Given the following DFA of which A is the start state and D is the accept state,
find the smallest equivalent DFA.
\begin{center}
\begin{tabular}{|c|c|c|}\hline
 & 0 & 1 \\\hline
\to A & B & A \\\hline
B & A & C \\\hline
C & D & B \\\hline
*D  & D & A \\\hline
E & D & F \\\hline
F & G & E \\\hline
G & F & G \\\hline
H & G & D \\\hline
\end{tabular}
\end{center}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{Exercise 4: No DFA for Prime.} 

In this problem, you are asked to prove that there does not exist such an DFA that recognizes the language of all prime numbers in binary representation.
For example, the DFA will accept, 10, 11, 101, 111 and reject 1, 100, 1001.
\begin{enumerate}
\item (step 1) Prove that if such a DFA M exists for prime numbers, then there is a infinite  sequence
of prime  numbers $a_0,a_1,...a_n,...$  with the  recursive form  that  $a_{i+1} = u a_i + v$ for some fixed integer $u>1$ and $v$ depending on  M.
\item  (step 2 (bonus)) Show that for such a sequence,  some $a_i (i >0)$  in $a_1,a_2,..a_{a_0}$ must be divisible by $a_{0}. 

 \end{enumerate}
 
\end{document}
