

\documentstyle[11pt,twoside,psfig]{article}
\input{defs-6045}
\begin{document}

\handout{quiz2}{Quiz 2}{April 9, 1992}


\medskip


Try to provide answers to all the questions even if you
do not solve them fully: we will give partial credit. Try also to
answer as precisely and concisely as you can.  You can consult your
class notes, your homeworks, the handouts given out in class and any
published book that you might have. 
All answers must be written in the blue answer book.  Please write your
name, your section instructor's name, and your section time on the front
of the blue book.

\begin{center}
{\Large Good Luck !}
\end{center}


\begin{enumerate}


\item (18 points)

Suppose $f : \{ 0,1 \}^* \rightarrow \{ 0,1 \}^*$ and
$A \subseteq \{ 0,1 \}^*$.
We let $f(A) = \{ f(x): x \in A \}$.
For each of the following statements, decide whether it is true -- in
which case you must provide a proof,
or false -- in which case you must exhibit a counterexample.
\begin{enumerate}
\item (6 points) If $A$ is a Turing-acceptable (r.e.) language 
and $f$ is a total recursive function then $f(A)$ is a
Turing-acceptable language.

\item (6 points)
  If $A$ is a recursive language and $f$ is a total recursive
function then $f(A)$ is a recursive language. (Hint: This is false.)

\item (6 points) If $f(A)$ is a recursive language and $f$ is a total recursive
function then $A$ is a recursive language.
\end{enumerate}

\item (21 points)
This is a short-answer question.
NO proofs or explanations are required.
There is no penalty for guessing.

Classify each of the following languages as follows:
\begin{tabbing}
   REC  \mbox{~~~~~~} \=    The language is recursive.\\
   UND  \>   The language is undecidable.
\end{tabbing}
\noindent If the language is undecidable, classify it further as either:
\begin{tabbing}
   R.E. \mbox{~~~~~~~} \=    The language is recursively enumerable but not recursive.\\
   co-R.E. \>  The complement of the language is recursively enumerable,
         but the language is \\
        \> not recursive. \\
   NONE \>    Neither the language nor its complement is recursively enumerable.
\end{tabbing}
Half-credit will be given to problems correctly marked ``UND'' without
further classification.

\begin{enumerate}

\item $\{ M$ (a Turing machine) : $L(M) = \emptyset \}$

\item $\{ 0^i 1^i : i \geq 0 \}$

\item $\{ M$ (a Turing machine) : $L(M) = \{ 0^i 1^i: i \geq 0 \} \}$

\item    $\{ x$ (a string): $x$ is the smallest word in $L(M)$, for some TM $M\}$
(Note:  ``Smallest'' refers to the canonical order, defined in the appendix below.)

\item    $\{ M $(a Turing machine): $M$, on blank input tape, outputs $e(M)$
         and halts. $\}$

\item     $\{ M$ (a Turing machine) : $L(M)$ is infinite $\}$

\item $\{ M$ (a Turing machine): M halts on all inputs within 5 steps $\}$

\end{enumerate}


\item (18 points)
A Turing machine is said to be {\em non-erasing} if it never changes
the content of a non-blank tape square.  (It may, as usual, write in
any blank tape square, but, having once done so, it will never
thereafter change the contents of that square.)  A {\it two-headed}
Turing machine has two read-write heads on its one-way infinite tape
(See Figure \ref{fig:thtm}).  SKETCH a proof that the ``halting
problem for two-headed, non-erasing Turing machines'' is undecidable.

(Hint: Give a reduction from the ordinary blank-tape halting problem,
where the machine produced by the reduction records successive
configurations without ever erasing anything.)

\begin{figure}[h]
\centerline{\mbox{\psfig{figure=head.ps,height=1in}}}
\caption{A Two-Headed Turing Machine}
\label{fig:thtm}
\end{figure}


\item (15 points)
Let $L = \{ M$ (a Turing machine with input alphabet $\Sigma$) : $M$ halts on
input $\Lambda$, and takes more than 100 steps to do so $\}$.
\begin{enumerate}
\item  Show that Rice's Theorem does not apply to $L$.
\item  Show that $L$ is nevertheless undecidable.
\end{enumerate}

\item (15 points)
Prove the the Post Correspondence Problem over a one-letter alphabet
is decidable.
That is, show that the problem is decidable in case all the strings
$\alpha_i$ and $\beta_i$ appearing in all the pairs of all instances
of the problem are elements of $\Sigma^*$, where $|{\Sigma}| = 1$. (Hint:
No complicated Number Theory is needed!)

\item (13 points)
Use the Recursion Theorem to prove the following rather strange claim.
There is some Turing machine $M$ that accepts exactly one string:
$e(M)$, the encoding of $M$.

\end{enumerate}

\begin{center}
{\LARGE Appendix (for your reference):}
\end{center}


When we assume a total ordering of strings over an alphabet $\Sigma$,
we mean the {\em canonical ordering}.
Recall that this orders strings by length, and among strings of the
same length, orders them ``alphabetically'', according to some fixed
ordering of the alphabet symbols in $\Sigma$.
For instance, if $\Sigma = \{ 0, 1 \}$, then
the order is:
$\Lambda < 0 < 1 < 00 < 01 < 10 < 11 < 000 < 001 < \ldots$.


\end{document}





  
