Homework 7
Last updated: Sat, 19 Mar 2022 21:47:37 -0400
Out: Mon Mar 21, 00:00 EST Due: Sun Mar 27, 23:59 EST
This assignment explores decidability and Turing machines that are deciders.
Homework Problems
Chomsky Normal Form (9 points)
An Algorithm About DFAs (10 points)
Another Algorithm About DFAs (10 points)
An Algorithm About CFGs (10 points)
README (1 point)
Total: 40 points
Submitting
Submit your solution to this assignment in Gradescope hw7. Please assign each page to the correct problem and make sure your solutions are legible.
A submission must also include a README containing the required information.
1 Chomsky Normal Form
Recall that a CFG is in Chomsky Normal Form (CNF) if all rules have the form:
A \rightarrow BC |
A \rightarrow \texttt{a} |
where \texttt{a} is a terminal, A, B, C are variables, and B and C are not the start variable.
In addition, a grammar in CNF may include rule S\rightarrow \varepsilon, where S is the start variable.
Convert the following context-free grammar to Chomsky Normal Form using the algorithm described in class.
E\rightarrow E \texttt{ + } T \mid T
T\rightarrow T \times F \mid F
F\rightarrow \texttt{(}E\texttt{)} \mid \texttt{a}
The start variable of the CFG is E and the set of terminals is \{\texttt{+},\times,\texttt{(},\texttt{)},\texttt{a}\}
2 An Algorithm About DFAs
Prove that the following language is decidable:
\mathrm{\textit{CS}}_{\textsf{DFA}} = \left\{\left\langle D\right\rangle\mid D\textrm{ is a DFA where }\texttt{CS420}\in L(D)\right\}
Remember that a decider must be accompanied by a termination argument.
3 Another Algorithm About DFAs
Prove that the following language is decidable:
\mathrm{\textit{EVEN}}_{\textsf{DFA}} = \left\{\left\langle D\right\rangle\mid D\textrm{ is a DFA that accepts all even length strings}\right\}
4 An Algorithm About CFGs
Prove that the following language is decidable:
\mathrm{\textit{XY}}_{\textsf{CFG}} = \left\{\left\langle G_1,G_2,w\right\rangle\mid G_1\textrm{ and }G_2\textrm{ are CFGs, and }w = xy\textrm{ where } x\in L(G_1)\textrm{ and }y\in L(G_2)\right\}