\documentclass[11pt]{amsart}

\usepackage{amsmath,amsthm,amssymb}
\usepackage{stmaryrd}

\usepackage{fancyhdr} % Allows customization of verbatim environments

\usepackage{xcolor}

%\usepackage[textheight=8.5in, margin=1.6in]{geometry}
\usepackage[
  hmarginratio={1:1},     % equal left and right margins
%  vmarginratio={1:1},     % equal top and bottom margins
  %textwidth=400pt,        % new text width
  heightrounded,          % always useful
  %bindingcorrection=5mm,  % binding correction
  total={6in,8in}
]{geometry}
\headheight=13pt
\footskip=13pt

\usepackage{needspace}  % <-- to prevent bad pagebreak over environment titles
% Use:  \Needspace{3\baselineskip} before opening an environment

\usepackage{graphicx}

% Tikz stuff.
\usepackage{tikz}
%\usepackage{tkz-graph}
\usepackage{pgfplots}
%\usepackage{tikz-3dplot}
\pgfplotsset{compat=newest}
%\usepgfplotslibrary{fillbetween}
%\usetikzlibrary{cd}
%\usetikzlibrary{positioning}
%\usetikzlibrary{decorations.pathmorphing}    
%\usetikzlibrary{decorations.pathreplacing}
%\usetikzlibrary{arrows.meta,calc}
%\usetikzlibrary{bending}
%\usetikzlibrary{decorations.markings,shapes.geometric}
%\tikzset{->-/.style={decoration={markings, mark=at position #1 with
%  {\arrow{>}}},postaction={decorate}}}
%\tikzset{-|-/.style={decoration={markings, mark=at position #1 with
%  {\arrow{stealth}}},postaction={decorate}}}
%\tikzset{movearrow/.style 2 args ={
%        decoration={markings,
%	  mark= at position {#1} with {\arrow{#2}} ,
%        },
%        postaction={decorate}
%    }
%}
%\tikzset{<--/.style={decoration={markings, mark=at position #1 with
%  {\arrow{<}}},postaction={decorate}}}
\tikzstyle{ball} = [circle,shading=ball, ball color=black,
    minimum size=1mm,inner sep=1.3pt]
%\tikzstyle{bball} = [circle,shading=ball, ball color=blue,
%    minimum size=1mm,inner sep=1.3pt]
%\tikzstyle{miniball} = [circle,shading=ball, ball color=black,
%    minimum size=1mm,inner sep=0.5pt]
%\tikzstyle{redminiball} = [circle,shading=ball, ball color=red,
%    minimum size=1mm,inner sep=0.5pt]
%\tikzstyle{mminiball} = [circle,shading=ball, ball color=black,
%    minimum size=0.6mm,inner sep=0.1pt]
%\tikzstyle{mycircle} = [draw,circle, minimum size=1mm,inner sep=1.3pt]
%\newcommand*{\DashedArrow}[1][]{\mathbin{\tikz [baseline=-0.25ex,-latex, dashed,#1] \draw [#1] (0pt,0.5ex) -- (1.3em,0.5ex);}}%

%%%% tikz style for finite automata
\usetikzlibrary{automata, positioning, arrows}
\tikzset{fa/.style={
    ->, % makes the edges directed
    >=stealth, % makes the arrow heads bold
    node distance=2cm, % 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
}}
%%%%

\usepackage{needspace}  % <-- to prevent bad pagebreak over environment titles
% Use:  \Needspace{3\baselineskip} before opening an environment

\usepackage[shortlabels]{enumitem}
\setlist[enumerate]{itemsep=4pt,leftmargin=*,label={(\alph*)},topsep=4pt}
%\setlist[enumerate]{itemsep=2pt,label={\arabic*.}}

\usepackage[T1]{fontenc}
\renewcommand{\labelitemi}{\guillemotright}

\allowdisplaybreaks

\usepackage[colorlinks=true,citecolor=black,linkcolor=black,urlcolor=blue]{hyperref}

\newcommand{\N}{\mathbb{N}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\C}{\mathbb{C}}
\newcommand{\W}{\mathbb{W}}
\newcommand{\KK}{\Bbbk}
\newcommand{\ve}{\varepsilon}
\newcommand{\scribe}{
  \begin{center}%
    Scribe~$=$ \rule{7cm}{0.15mm}%
  \end{center}%
  \medskip%
}
\DeclareMathOperator{\im}{\mathrm{im}}
\DeclareMathOperator{\id}{\mathrm{id}}
\DeclareMathOperator{\glb}{\mathrm{glb}}
\DeclareMathOperator{\lub}{\mathrm{lub}}

\newcounter{problem}
\renewcommand \thesection {\theproblem}
\newenvironment{prob}[1][]
{
\refstepcounter{problem}\par\medskip
\def\myArg{#1}
  \ifx\myArg\empty
    \noindent \textsc{Problem~\theproblem.} \rmfamily
  \else
    \noindent \textsc{Problem~\theproblem\ (\textnormal{#1}).} \rmfamily
  \fi
}
{
\medskip

}

\newenvironment{sol}
{\emph{Solution.}
}
{
  \medskip

}

\parskip = 0.05in
\parindent = 0.0in
\raggedbottom

%\pagestyle{empty}
%\pagenumbering{gobble}

\fancypagestyle{firststyle}
{
\fancyhead[L,LO]{
\textit{\small Math 387 Group problems, Monday Week 13}
}
\renewcommand{\headrulewidth}{0pt}
}

\begin{document}
\thispagestyle{firststyle}
\bigskip

\textsc{Review} (Several of these problems are variations of problems I found
online for a course at York University.)
\bigskip

\begin{prob}
  Give a regular expression that generates the same language as the FA shown
  below:
  \begin{center}
    \begin{tikzpicture}[fa,baseline={([yshift=-1em] current bounding box.north)}]
      \node[state, initial] (1) {$q_{1}$};
      \node[state, above right of=1,xshift=1cm] (2) {$q_{2}$};
      \node[state, below right of=1,xshift=1cm] (3) {$q_{3}$};
      \node[state, accepting, above right of=3,xshift=1cm] (4) {$q_{4}$};
      \draw (1) edge[above] node{$0$} (2);
      \draw (1) edge[below] node{$1$} (3);
      \draw (2) edge[left, bend right] node{$0$} (3);
      \draw (3) edge[right, bend right] node{$1$} (2);
      \draw (2) edge[above] node{$0$} (4);
      \draw (3) edge[below] node{$1$} (4);
      \draw (4) edge[loop right, right] node{$0,1$} (4);
    \end{tikzpicture}
  \end{center}
\end{prob}

\begin{prob}
  Give an example of two recognizable languages~$L_{1}$ and~$L_{2}$ such
  that~$L_{1}\setminus L_{2}$ is not recognizable.  Explain your answer.
\end{prob}

\begin{prob}
  Prove whether each of the following languages is decidable:
  \begin{enumerate}
    \item \ 
      \begin{enumerate}[(i)]
	\item $L_{1}=\{\langle M\rangle: \text{$M$ is a TM that accepts every string}\}$.
	\item $L_{2}=\{\langle M\rangle: \text{$M$ is a TM that rejects some string}\}$.
	\item $L_{3}=\{\langle M\rangle: \text{$M$ is a TM that $L(M)$ is a CGL}\}$.
	\item $L_{4}=\{\langle M\rangle: \text{$M$ is a TM that accepts some string
	  after running at most $10$ steps}\}$.
      \end{enumerate}
    \item State Rice's theorem.
    \item For each of the above, explain why Rice's theorem above or why it does
      not.
  \end{enumerate}
\end{prob}

\begin{prob}
  Consider the language
  \begin{align*}
    L &= \{\langle M\rangle: \text{$M$ is a Turing machine which upon
      input~$\varepsilon$}\\
      &\qquad\qquad\qquad\text{eventually prints a character on its $1000$-th
    tape cell} \}.
  \end{align*}
  What is the status of~$L$: decidable, undecidable, recognizable,
  unrecognizable?
\end{prob}

\begin{prob}
  You would like to prove that a language~$L$ is recognizable but not decidable.
  You could do this by proving two of the following.  Which two?
  \begin{enumerate}
    \item $L\leq_{m}A_{TM}$
    \item $L\leq_{m}\overline{A_{TM}}$
    \item $\overline{L}$ is decidable
    \item $\overline{A_{TM}}\leq_{m} L$.
    \item $\overline{E_{TM}}\leq_{m}L$
  \end{enumerate}
\end{prob}

\begin{prob}
  Is the following language decidable? Recognizable?  Provide a proof.
  \[
    \{\langle G_{1},G_{2}\rangle: \text{$G_{1}$ and~$G_{2}$ are CFGs
    and~$L(G_{1})\neq L(G_{2})$}\}.
  \]
\end{prob}

\begin{prob}
  Give an example of a non-regular language~$A$ such that~$A^{*}$ is regular.
\end{prob}
\end{document}
