\documentclass[11pt]{article}

\usepackage{exscale}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{latexsym}
\usepackage{times,mathptm}
\usepackage{epsfig}
\usepackage{amsmath}

\textwidth 6.5truein          
\textheight 9.0truein
\oddsidemargin 0.0in
\topmargin -0.8in

\parindent 0pt          
\parskip 0pt
%\def\baselinestretch{1.1}

\begin{document}

\begin{large}
\centerline {\bf Computer Science 423}
\centerline {\bf Fall 2024}
\centerline {\bf Homework 7}
\centerline{\bf My name and section}
%\end{large}
\vskip .5cm

%\begin{Large}
\bf Due: beginning of class, Thursday, 10/31/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 {[3 points each]}  For each statement below, state whether it is True or False.  No explanation necessary.
\begin{enumerate}
\item We can construct a PDA for the language $L=\{a^{2n}b^n |\ n =\ 1,2,3,...\}$ by first constructing a FA for $L$, and then converting the FA into a PDA for $L$.
\item Every CFG has an equivalent deterministic PDA.
\item Let $P$ be a PDA with the property that, when reading a string, it can never put more than three total symbols on the stack.  $L(P)$ must therefore be regular.
\item Converting any CFG to Chomsky normal form will ensure that it is unambiguous.
\item If a PDA accepts language $L$, but does not require the stack to do so, $L$ can be generated by a regular expression.

\end{enumerate}

Collaborators:

\item {[5 points]} Show that the following grammar is ambiguous.
\begin{eqnarray*}
S&\rightarrow& aB\ |\ bA\\
A&\rightarrow& aS\ |\ bAA \ |\ a\\
B&\rightarrow& bS\ |\ aBB\ |\ b
\end{eqnarray*}

Collaborators:


\item {[7 points]} Convert the following CFG into an equivalent CFG in Chomsky normal form.  Show (and number) each
of the four steps, as in the class slides.
\begin{eqnarray*}
S&\rightarrow& XY\\
X&\rightarrow& abb\ |\ aXb \ |\ \epsilon\\
Y&\rightarrow& c\ |\ cY
\end{eqnarray*}

Collaborators:


\item {[9 points]} Convert the following CFG into an equivalent CFG in Chomsky normal form.  Show (and number) each
of the four steps, as in the class slides.
\begin{eqnarray*}
S&\rightarrow& T\ |\ TST\ | \ \epsilon\\
T&\rightarrow& 10\ |\ \epsilon
\end{eqnarray*}

Collaborators:


\item {[14 points]} Provide a PDA that recognizes language $L_1$.  Show both a state diagram and the 6-tuple specification (including a transition table).

\begin{eqnarray*}
 L_1&=\{a^ib^jc^k\ |\ i,j,k \ge 0 \ and\ i+j=k\}
\end{eqnarray*}

Collaborators:

\end{enumerate}

\end{document}
