\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 11}
\centerline{\bf My name and section}
%\end{large}
\vskip .5cm

%\begin{Large}
\bf Due: beginning of class, Tuesday, 12/3/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 {[2 points each]}  For each statement below, state whether it is True or False.  No explanation necessary.
\begin{enumerate}
\item A problem with a polynomial-time verifier cannot be solved in polynomial time by any known algorithm.
\item It is possible that P = coNP.
\item If a polynomial solution is found for one NP-complete problem, then all NP-complete problems can be solved in polynomial time.
\item SAT reduces to 3SAT since 3SAT is a special case of SAT; however, 3SAT does not reduce to SAT.
\item All NP-complete problems are reducible to HAMPATH.
\end{enumerate}

Collaborators:\\

\item {[20 points]} Consider the following $SUBSTRING$ problem.
$$SUBSTRING = \{<S,b> |\ b\ {\rm is\ a\ substring\ of}\ S\}$$
\begin{enumerate}
\item {[7 points]} Design a single-tape deterministic TM $R$ that decides $SUBSTRING$.  Initialize the tape by first writing the substring $b$, 
then \#, and finally the string $S$.
\item {[3 points]} If the length of $b$ is $m$ and the length of $S$ is $n$, what is the big-O complexity of $R$?
\item {[7 points]} Design a two-tape deterministic TM $T$ that decides $SUBSTRING$.  Write $b$ on tape 1 and $S$ on tape 2.
\item {[3 points]} Given the lengths of $b$ and $S$ in (b), what is the big-O complexity of $T$?

\end{enumerate}

Collaborators:\\

\item {[5 points]} Use Euclid's algorithm to determine if the following pair of numbers is relatively prime: 1274 and 10505.\\

Collaborators:\\

\newpage

\item {[15 points]} Consider the $TRIANGLE$ problem.
$$TRIANGLE = \{<G> |\ G\ {\rm contains\ a\ triangle}\}$$
\begin{enumerate}
\item {[4 points]} Design a single-tape deterministic TM $T$ that decides $TRIANGLE$ by testing all groups of three vertices for a triangle.
\item {[3 points]} If $G$ has $n$ nodes, how many different groups of three nodes is possible?  {Hint: use a permutation or combination formula.}
\item {[2 points]} From your previous two answers, what is the big-O complexity of $T$?
\item {[4 points]} Design a verifier $V$ for $TRIANGLE$.
\item {[2 points]} Is $TRIANGLE$ $\in$ {P}?  Is $TRIANGLE$ $\in$ {NP}?  No eplanation required.

\end{enumerate}

Collaborators:

\end{enumerate}

\end{document}
