\documentclass[11pt]{article}
\usepackage{amsfonts}
\usepackage{latexsym}
\usepackage{epsfig}           %This allows to insert figures in .eps format
\setlength{\oddsidemargin}{.25in}
\setlength{\evensidemargin}{.25in}
\setlength{\textwidth}{6in}
\setlength{\topmargin}{-0.4in}
\setlength{\textheight}{8.5in}

\newcommand{\handout}[5]{\renewcommand{\thepage}{#1-\arabic{page}}\noindent\begin{center}\framebox{\vbox{\hbox to 5.78in { {\bf Finite Automata and Theory of Computation} \hfill #2 }\vspace{4mm}\hbox to 5.78in { {\Large \hfill #5  \hfill} }\vspace{2mm}\hbox to 5.78in { {\it #3 \hfill #4} }}}\end{center}\vspace*{4mm}}
\newcommand{\ho}[5]{\handout{#1}{#2}{Professor: #3}{#4}{Handout #1: #5}}
\newcommand{\exam}[4]{\handout{#1}{#2}{Professor: #3}{#4}{Exam #1}}
\newcommand{\pset}[4]{\handout{HW#1}{Due: #2}{Professor: #3}{}{#4: Homework #1}}

\newcommand \lang {\mathcal{L}}
\newcommand \ATM {\mathsf{A_{TM}}}
\newcommand \cP {\mathsf{P}}
\newcommand \NP {\mathsf{NP}}
\newcommand \coNP {\mathsf{coNP}}
%\newcommand \3SAT {\mathsf{3-SAT}}
\newcommand \SAT {\mathsf{SAT}}

\begin{document}
\pset{9}{November 29, 2007}{Moses Liskov}{****INSERT YOUR NAME****}

\section*{Problem 1}

$ALL_{DFA} = \{\langle M \rangle | M$ is a DFA such that $\lang(M) =
\Sigma^*\}$.  

\bigskip {\bf (a)}  Prove that $ALL_{DFA} \in \cP$.

\bigskip {\bf Solution:} *** INSERT SOLUTION ***

\bigskip {\bf (b)} Let $ALL_{NFA}$ be the corresponding language, but
for NFAs instead of DFAs.  Can you modify your algorithm for part (a)
to make a polynomial-time algorithm for $ALL_{NFA}$?  If so, how?  If
not, what are the difficulties?

\bigskip {\bf Solution:} *** INSERT SOLUTION ***


\section*{Problem 2}

Show that if $L \in \cP$ then $L^* \in \cP$.  ({\em Hint: Use dynamic
programming: determine whether every substring of $w$ is in $L^*$,
starting with small substrings and building up.})

\bigskip {\bf Solution:} *** INSERT SOLUTION ***

\section*{Problem 3}

Let $POW = \{\langle n \rangle | n$ is a positive integer such that there are
positive integers $m, a$ such that $n = m^a$ and $a > 1\}$.

Prove that $POW \in \NP$.  

\bigskip {\bf Solution:} *** INSERT SOLUTION ***

\section*{Problem 4}

Prove that $POW \in \cP$.  You may assume that you can compute $n$th
roots in polynomial time.

\bigskip {\bf Solution:} *** INSERT SOLUTION ***

\section*{Problem 5}

Prove that for every language $L \in \NP$ there is a language $L' \in
P$ and a polynomial $p$ such that $x \in L$ if and only if there
exists a $y$ such that $\langle x, y \rangle \in L'$ and $|y| \leq
p(|x|)$.  {\em Hint: think of $y$ as the nondeterministic choices made
by the $\NP$ machine $M$ that accepts $L$.}

\bigskip {\bf Solution:} *** INSERT SOLUTION ***

\section*{Problems 6 and 7}

Let $\mathsf{DOUBLESAT} = \{\langle \phi \rangle | \phi$ is a boolean
formula that can be satisfied in at least {\em two} different
ways$\}.$

\bigskip \noindent {\bf (a) (4 points)} Give an example of a member
and a non-member of $\mathsf{DOUBLESAT}$.

\bigskip {\bf Solution:} *** INSERT SOLUTION ***


\bigskip \noindent {\bf (a) (6 points)} Prove that
$\mathsf{DOUBLESAT}$ is in $\NP$.

\bigskip {\bf Solution:} *** INSERT SOLUTION ***

\bigskip \noindent {\bf (b) (10 points)} Prove that
$\mathsf{DOUBLESAT}$ is $\NP$-complete.

\bigskip {\bf Solution:} *** INSERT SOLUTION ***

\section*{Problem 8 (optional)}

The class $\coNP$ is the set of languages $L$ such that $\overline{L}
\in \NP$.  Prove that:

\bigskip \noindent {\bf (a)} $\cP \subset \coNP$.

\bigskip {\bf Solution:} *** INSERT SOLUTION ***

\bigskip \noindent {\bf (b)} $\cP = \coNP$ if and only if $\cP = \NP$.

\bigskip {\bf Solution:} *** INSERT SOLUTION ***

\end{document}