\documentclass[11pt]{article}

\usepackage{fullpage,times,epsfig}

\begin{document}

\section*{Computability and Logic Homework 3}

\noindent
\textbf{Due: } Thursday, September 22, 2005

\bigskip\noindent
Each of problems 1 through 3 is worth 10 points.  Problem 4 is worth
20 points.

\paragraph{1. Homorphisms} A \emph{homomorphism} of strings is a function $f : \Sigma^* \to
\Sigma^*$ such that $f(\Lambda) = \Lambda$ and for any $u,v \in
\Sigma^*$, $f(uv) = f(u)f(v)$.  For any language $L \subseteq
\Sigma^*$, $f[L]$ denotes the image of the set $L$ under $f$, that is:
\[
f[L] = \{f(w)\ |\ w \in L\}
\]
and $f^{-1}[L]$ denotes the inverse image of $L$ under $f$, that is:
\[
f^{-1}[L] = \{w\ |\ f(w) \in L\}.
\]
\begin{itemize}
\item[a.] Prove \textbf{by induction} that if $L$ is regular, then
  $f[L]$ is regular.  (The case for star is the most interesting.)
\item[b.] Sketch a proof of the same fact using finite automata.
  (Hint: at least one of the automata featured in the proof should
  probably be nondeterministic.)
\item[c.] Argue, however you like, that if $L$ is regular then
  $f^{-1}[L]$ is regular.  Your proof need not be formal.
\end{itemize}

\paragraph*{2. Divisibility and Regularity}
{\def\lsem{[\![}
\def\rsem{]\!]}
\def\imod{\mathrel{\mathrm{mod}}}
Let $\Sigma = \{0,\ldots,9\}$.  For each string $w \in \Sigma^*$,
define $\lsem w\rsem$ to be the integer ``denoted'' by $w$, as follows:
$[\![\Lambda]\!] = 0$, and for any string $w$ and digit $i$,
$[\![wi]\!] = 10[\![w]\!]+i$.  
\begin{itemize}
\item[a.]
Prove that each of the following languages is regular:
\begin{enumerate}
\item $\{w \ |\  \lsem w \rsem \textit{ is even}\}$
\item $\{w \ |\  \lsem w \rsem \textit{ is a multiple of } 4\}$
\item $\{w \ |\  \lsem w \rsem \textit{ is a multiple of } 3\}$
\end{enumerate}
\item[b.] Prove or disprove: For any $n>1$, the language
\(
D_n = \{w \ |\ \lsem w \rsem \textit{ is a multiple of } n\}
\)
is regular.
\end{itemize}

\paragraph{3. Indistinguishability}
\begin{itemize}
\item[a.] What are the equivalence classes of $\equiv_L$ (the
  indistinguishability relation defined in class) for the language $L
  = \{a^nb^n\ |\ n \geq 1\}$?
\item[b.] What about for $L = \{w
  \in \{a,b\}^*\ |\ w \textit{ has the same number of } a
\textit{'s as }b\textit{'s}\}$?
\item[c.] Which, if either, of these languages is/are regular?
\end{itemize}

\paragraph{4. Subset Construction and State Minimization} 
Construct a minimum-state DFA to
accept the language $aa(a+b)^* + (a+b)^*bb$ by taking the following
three steps:
\begin{enumerate}
\item Construct an NFA that accepts the language.
\item Convert that NFA to an equivalent DFA.
\item Perform the state minimization algorithm on that DFA.
\end{enumerate}
Show the automaton you construct in each step.

\end{document}