\documentclass[11pt]{article}

\usepackage{exscale}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{latexsym}
\usepackage{times,mathptm}
\usepackage{epsfig}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{automata, positioning, arrows, decorations}

\textwidth 6.5truein          
\textheight 9.0truein
\oddsidemargin 0.0in
\topmargin -0.8in

\parindent 0pt          
\parskip 0pt
%\def\baselinestretch{1.1}

\tikzset{
->, % makes the edges directed
%>=medium, % makes the arrow heads bold
node distance=3cm, % specifies the minimum distance between two nodes. Change if necessary.
every state/.style={thick, fill=gray!10}, % sets the properties for each ’state’ node
initial text=$ $, % sets the text that appears on the start arrow
}


\begin{document}

\begin{large}
\centerline {\bf Computer Science 423}
\centerline {\bf Fall 2024}
\centerline {\bf Homework 10}
\centerline{\bf My name and section}
%\end{large}
\vskip .5cm

%\begin{Large}
\bf Due: beginning of class, Tuesday, 11/21/2024 \hfill Points: 50
\end{large}
\vskip 0.3cm
Answer the following questions and submit typeset solutions by the due date.  As stated on the syllabus, any collaborators or 
outside sources must be listed under the corresponding problem.  Further, your final submission must be completely your own work.
\begin{enumerate}


\item {[25 points]} Consider the following language and the Turing machine that recognizes it:

\begin{eqnarray*}
 L_1&=\{a^nb^n\ |\ n \ge 1\}
\end{eqnarray*}

\begin{center}
\begin{tikzpicture}
\node[state, initial] (q0) {$q_0$};
\node[state, right of=q0] (q1) {$q_1$};
\node[state, right of=q1] (q2) {$q_2$};
\node[state, right of=q2] (qa) {$q_{accept}$};

\draw [thick]
         (q0) edge[above] node{$a\rightarrow X$,R} (q1)
         (q1) edge[loop,above] node[align=center]{$a\rightarrow$ R\\ $Y\rightarrow$ R} (q1)
         (q1) edge[above] node{$b\rightarrow\ Y$,R} (q2)
         (q2) edge[loop,above] node[align=center]{$a\rightarrow$ L\\ $b\rightarrow$ L\\ $Y\rightarrow$ L} (q2)
         (q2) edge[bend left,below] node{$X \rightarrow$ R} (q0)
         (q2) edge[above] node{$\sqcup \rightarrow$ L} (qa);
\end{tikzpicture}
\end{center}


Answer the following for using this Turing machine for the Post Correspondence Problem (PCP):
\begin{enumerate}
\item {[4 points]} List all the $\delta$ functions for the Turing machine.
\item {[4 points]} Create the tiles associated with the $\delta$ functions from (a), as in Parts 2 and 3 of the PCP simulation.
\item {[3 points]} Create additional tiles, as in Parts 4, 5, and 6 of the PCP simulation.
\item {[14 points]} Run the simulation on $aabb$ until a match is achieved.  Diagonal lines aligning the top substrings with the bottom replacements
need not be drawn; however, place vertical bars around the main substring to be replaced in each configuration in the top line, along with vertical bars around
the corresponding replacement string in each of the configurations in the bottom line.  Since the strings will be quite long, write only four configurations per line.
\end{enumerate}

Collaborators:

\newpage

\item {[2 points each]}  For each statement below, state whether it is True or False.  No explanation necessary.
\begin{enumerate}
\item log $n$ = O($n$) AND $.001n^2$ = o($n^2$).
\item Every function is big-O of itself.
\item Some functions are small-o of themselves.
\item Any problem in NP can be solved by an exponentially slow algorithm.
\item No polynomial time algorithm currently exists for any NP problem.
\end{enumerate}

Collaborators:\\

\item {[5 points]} Consider the following Turing Machine:
\\
\\E = ``On input $<G>$ where $G$ is an undirected graph:
 \begin{enumerate}
 \item[1.] For each subset of nodes in $G$:
 \item[2.] \ \ \ Determine if there are any cycles.
 \item[3.] \ \ \ If so, $reject$.
 \item[4.] If loop ended without rejecting, $accept$.''
 \end{enumerate}

Is the problem represented by the above Turing machine in P or NP?  Why?\\

Collaborators:\\

\item {[10 points]} Recall the $HAMPATH$ problem.

\begin{enumerate}
\item Prove the problem is in NP by creating a verifier, as on slide 81 of Chapter 7.  Hint: the collection of nodes will be the certificate.
\item Prove the problem is in NP by using an alternate proof with a nondeterministic Turing Machine, as on slide 82 of Chapter 7.
\end{enumerate}

Collaborators:

\end{enumerate}

\end{document}
