

% 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}

% 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\TR{{\mathrm{R}}}


\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 5} \\  {\bf Due Monday, February 7, 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}

Recall that $w^\TR$ is the reversal of~$w$, namely $w$~written backwards.

Give your answers by completely describing a Turing machine,
preferably with a state diagram.
Use the input alphabet $\Sigma = \{0,1\}$. You may use any tape alphabet~$\Gamma$ you wish.

(The problems are not in order of difficulty.)


\noindent
{\bf 1.}
Prove that the function $w \mapsto w^\TR$ is Turing computable. 
(Hint: You may change $w$ to~$w^\TR$ in place, but it is not necessary to do this.)

\noindent
{\bf 2.}
Prove that the set $\{ w \in \Sigma^* : w = w^\TR \}$ is Turing decidable.

\noindent{\bf 3.}
Prove that the set $\{ 1^n0 : n\ge 0 \} = \{0, 10, 110, 1110, 11110, \ldots \}$
is Turing decidable.

\noindent{\bf 4.}
Prove that the set $\{ 1^n0 : n\ge 0 \} = \{0, 10, 110, 1110, 11110, \ldots \}$
is Turing enumerable by giving a machine that enumerates it.

\end{document}
