\documentclass[11pt]{article}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{hyperref}
\usepackage[margin=1in]{geometry}
\setlength{\parindent}{0pt}
\setlength{\parskip}{1em}

\usepackage{syntax}
% tikz package and associated configuration for drawing automata
\usepackage{tikz}
\usetikzlibrary{automata, positioning, arrows}
\tikzset{
->, % makes the edges directed
>=stealth', % 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
}

\title{CSCI 301 - Assignment 9, Fall 2024}
\author{Your name here}
\date{}

\newcommand{\answer}{%
  \par\noindent%
  \textbf{Answer\\}%
}

\newcommand{\inlineanswer}{%
  \hspace{1em} \textbf{Answer:} %
}

\begin{document}

\maketitle

Modify the .tex source file for this document, adding your answers below each question.
This is an individual assignment. See the syllabus for the collaboration policy. 

\begin{enumerate}

\item Prove that the language $L_1 = \{ww : w \in \{0,1\}^*\}$ is not regular.

    \answer Write your answer here.

\item Construct a (deterministic or nondeterministic) pushdown automaton that
    accepts the language $L_2 = \{0^n1^m0^n\}$. 

        \answer \textbf{Idea:} \textit{Replace this text with an intuitive
        English explanation of how this machine will process strings to accept
        strings in $L_2$. Then replace the $\ldots$ in each of the components
        below and fill in the transition table to formally specify your
        machine. Your table should include commentary describing the purpose
        of each transition rule, if it's not obvious.}

        Let $M_2 = (\Sigma, \Gamma, Q, \delta, q)$, where

\begin{itemize}
    \item $\Sigma = \{0, 1\}$
    \item $\Gamma = \{\ldots\}$
    \item $Q = \{\ldots\}$
    \item $q = \ldots$, and
    \item  $\delta : Q \times (\Sigma \cup \square) \times \Gamma \rightarrow Q
        \times \{R, N\} \times \Gamma^*$ is given in the table below:

        \begin{tabular}{c|c|p{25em}}
    Input             & Output           & Commentary \\\hline
        $q \square S$ & $q_1 N \epsilon$ & Example transition function entry (delete this one) \\\hline
    \end{tabular}

\end{itemize}

\item Construct a one-tape Turing machine that accepts the language $L_3 = \{0^{2n} 1^n\}$.

        \answer \textbf{Idea:} \textit{Replace this text with an intuitive
        English explanation of how this machine will process strings to accept
        strings in $L_3$. Then replace the $\ldots$ in each of the components
        below and fill in the transition table to formally specify your
        machine. Your table should include commentary describing the purpose
        or ``mode of operation'' of each state, if it's not obvious.}

    Let $M_3 = (\Sigma, \Gamma, Q, \delta, q_0, q_A, q_R)$, where
\begin{itemize}
    \item $\Sigma = \{0, 1\}$
    \item $\Gamma = \{\ldots\}$
    \item $Q = \{\ldots\}$
    \item $q_{start} = \ldots$, and
    \item $q_{accept} = \ldots$, and
    \item $q_{reject} = \ldots$, and
    \item $\delta : Q \times (\Sigma \cup \square) \times \Gamma \rightarrow Q
        \times \{R, N\} \times \Gamma^*$ is given in the table below:

    \begin{tabular}{r|c|c|c|p{20em}}
        \textbf{State} & \textbf{0}      & \textbf{1} &  $\square$       & Commentary \\\hline
        $q_0$          & $q_1 \square R$ & $q_0 1 R$  &  $q_0 \square R$ & Example transition function entry (delete this one) \\\hline
    \end{tabular}
\end{itemize}



\end{enumerate}

\end{document}

