

% Document Specific Preamble

\documentclass[12pt]{report}
\usepackage{amssymb}
\usepackage{enumitem}
\usepackage{multicol}
\usepackage{fdsymbol}   % \Vdash symbol (alternative definition)

% \usepackage{mathabx} % Alternate \Dashv

\voffset=-20pt
\textheight=9.3in
\addtolength{\topmargin}{-1.2in}
\addtolength{\oddsidemargin}{-.875in}
\addtolength{\evensidemargin}{-.875in}
\addtolength{\textwidth}{1.0in}
\pagestyle{empty}

%
% Proof Systems, etc.
%
\def\PL{{\mathrm{PL}}}
\def\FO{{\mathrm{FO}}}
\def\PA{{\mathrm{PA}}}

%
% Logical syntax and symbols
%
\def\liff{\leftrightarrow}
\def\limplies{\rightarrow}
\def\tautEq{\vDash\Dashv}
\def\True{{\mathrm T}}
\def\False{{\mathrm F}}

\def\bigand{\bigwedge}
\def\bigor{\bigvee}

\def\lgn{\ulcorner}
\def\rgn{\urcorner}


% Other symbols
\def\pprime{{\prime\prime}}
\def\mathfrakA{{\mathfrak A}}
\def\mathfrakB{{\mathfrak B}}
\def\mathfrakC{{\mathfrak C}}

%
% Provability with subscripts & superscripts
%
\newdimen\srbdimenA
\newcommand{\vdashsupsub}[2]{ \mathop{
  \setbox251 = \hbox{$\scriptstyle #1$}
  \setbox252 = \hbox{$\scriptstyle #2$}
  \ifdim \wd251<\wd252 \srbdimenA = \wd252 \else \srbdimenA = \wd251 \fi
  \setbox255 = \hbox {${\srbAvdash \vphantom( \kern -\srbdimenA \kern +.05em}
                  ^{\hbox to\srbdimenA{\hfill \box251\hfill}}
                  _{\hbox to\srbdimenA{\hfill \box252\hfill}}$}
  \box255 \kern .05em}}
\newcommand{\srbAvdash}{\hbox{ \vrule height1.4ex width0.02em
				\dimen255 = \srbdimenA
				\advance\dimen255 by 0.1em
                              \vbox{\hrule width\srbdimenA height0.02em
                                    \kern .65ex  }}}
\newcommand{\vdashsup}[1]{\vdashsupsub{{#1}}{\mbox{~}}}
\newcommand{\vdashsub}[1]{\vdashsupsub{\mbox{~}}{#1}}

%
% Text in mathematics
%
\def\FmlaName{\mathit}
\def\ConnectiveName{\mathit}
\def\TBook{{\FmlaName{Book}}}
\def\TLikes{{\FmlaName{Likes}}}
\def\TJazz{{\FmlaName{Jazz}}}
\def\TKpop{{\FmlaName{Kpop}}}
\def\TKnows{{\FmlaName{Knows}}}
\def\TJoan{{\FmlaName{Joan}}}
\def\TMother{{\FmlaName{Mother}}}
\def\TPrime{{\FmlaName{Prime}}}
\def\TPrimePower{{\FmlaName{PrimePower}}}
\def\TRead{{\FmlaName{Read}}}
\def\TDog{{\FmlaName{Dog}}}
\def\TCat{{\FmlaName{Cat}}}
\def\TPerson{{\FmlaName{Person}}}
\def\TTime{\FmlaName{Time}}
\def\Ptime{{\mathrm P}}
\def\NP{{\mathrm{NP}}}
\def\TCase{{\ConnectiveName{Case}}}
\def\TMaj{{\ConnectiveName{Maj}}}
\def\THalt{{\mathrm{Halt}}}
\def\TSelf{{\mathrm{Self}}}
\def\TTotal{{\mathrm{Total}}}
\def\TR{{\mathrm{R}}}
\def\TTM{{\mathrm{TM}}}
\def\TBB{{\mathrm{BB}}}
\def\TBBsteps{{\mathrm{BB_{steps}}}}



\def\TAtMost{{\FmlaName{AtMost}}}
\def\TAtLeast{{\FmlaName{AtLeast}}}
\def\TExactly{{\FmlaName{Exactly}}}

%
% Spacing for compact truth tables
%
\def\cnspace{\hskip3pt}


\begin{document}


\begin{center}
{\bf Math 160B - Winter 2022 -
\bf Homework 6} \\  {\bf Due Wednesday, February 16, 11:00am} \\
(Hand in by uploading to Gradescope)
\end{center}

\vskip -1.0em

% Set paragraph style: No indentation, skip one line.
\setlength{\parindent}{0em}
\setlength{\parskip}{\baselineskip}

% item environments
\setlist[itemize]{font=\rm,itemsep=3pt,parsep=0pt,topsep=0pt}
\setlist[enumerate]{font=\rm,itemsep=3pt,parsep=0pt,topsep=5pt}
\setlist[enumerate]{label=(\alph*)}
\setlist[description]{font=\em,itemsep=3pt,parsep=0pt,topsep=5pt}

\noindent
{\bf 1.}
Give the state diagram for a Turing machine that uses only the
tape symbols $\Gamma = \{0, 1, \#\}$ and computes
the symbol-doubling function
\[
a_1 a_2 \cdots a_{n-1} a_n \mapsto a_1 a_1 a_2 a_2 \cdots a_{n-1} a_{n-1} a_n a_n
\]
where $0$'s are replaced with ``$00$'', and $1$'s with ``$11$''.

\noindent
{\bf 2.}
Prove that there is no Turing machine~$M$ such that: (a)~If $M$ is started with the input
tape is completely blank, then $M$~accepts, and (b)~If there is a non-blank
symbol anywhere on the tape when $M$ starts, then $M$~rejects.

\noindent
{\bf 3.}
Define $\TTotal$ to be the set
\[
\TTotal ~=~ \{ \lgn M \rgn : \hbox{Algorithm $M$ halts on all inputs~$w$} \}.
\]
In other words, $\TTotal$ is the set of G{\"o}del numbers~ $\lgn M \rgn$
such that $M$ computes a (total) function.
\begin{enumerate}
\item Give a many-one reduction from $\THalt_0$ to $\TTotal$.
\item Give a many-one reduction from $\overline{\THalt_0}$ to $\TTotal$.
$\overline{\THalt_0}$ denotes the complement of~$\THalt_0$.
\item Prove that $\TTotal$ is neither c.e.\ nor co-c.e.
\end{enumerate}


\noindent{\bf 4.}
(The Busy Beaver function for running time.) For this problem and the
next problem, restrict attention
to Turing Machines over the alphabets $\Sigma = \Gamma = \{1,\$\}$.
Define the
running-time version of
the Busy Beaver function $\TBBsteps: \mathbb N \rightarrow \mathbb N$ by
\[
\TBBsteps(n) ~=~ \max \{ m \ge 0 : \hbox{\parbox[t]{3.5in}{\raggedright
    there is a Turing Machine~$M$ with $n$ states \newline
    \hspace*{2ex}such that $M(\epsilon)$ halts after exactly $m$ steps.~$\}$}}
\]
\begin{enumerate}
\item Prove that $\TBBsteps(n)$ is not computable by proving that otherwise
$\THalt^\TTM_0$ would be decidable. $\THalt^\TTM_0$ is the version of $\THalt_0$ that
applies to algorithms which are specified as Turing machines.
\item Suppose $f: \mathbb N \rightarrow \mathbb N$ is computable. Prove that $\TBBsteps(n)$
eventually dominates~$f$, namely there is an~$N$ such that $f(n)<\TBBsteps(n)$ for all
$n>N$.
\end{enumerate}

\noindent{\bf 5.}
(Busy Beaver function for output value.)
Use the same conventions as the previous problem.
The Busy Beaver function $\TBB: \mathbb N \rightarrow \mathbb N$
is defined by
\[
\TBB(n) ~=~ \max \{ m \ge 0 : \hbox{\parbox[t]{3.5in}{\raggedright
    There is a Turing Machine~$M$ with $n$ states such \newline
    \hspace*{2ex}that $M(\epsilon)$ halts with $m$ many~$1$'s written on the tape.~$\}$}}
\]
Suppose $f: \mathbb N \rightarrow \mathbb N$ is computable. Prove that $\TBB(n)$
eventually dominates~$f$. Conclude that $\TBB$ is not computable.

\end{document}
