Paper 3, Section I, 4H4 \mathrm{H}

Automata and Formal Languages
Part II, 2019

(a) Define what it means for a context-free grammar (CFG) to be in Chomsky normal form (CNF). Can a CFG in CNF ever define a language containing ϵ\epsilon ? If GChom G_{\text {Chom }} denotes the result of converting an arbitrary CFG GG into one in CNF, state the relationship between L(G)\mathcal{L}(G) and L(GChom )\mathcal{L}\left(G_{\text {Chom }}\right).

(b) Let GG be a CFG in CNF. Give an algorithm that, on input of any word vv on the terminals of GG, decides if vL(G)v \in \mathcal{L}(G) or not. Explain why your algorithm works.

(c) Convert the following CFG GG into a grammar in CNF:

SSbbaSTTcc\begin{aligned} S \rightarrow & S b b|a S| T \\ & T \rightarrow c c \end{aligned}

Does L(G)=L(GChom )\mathcal{L}(G)=\mathcal{L}\left(G_{\text {Chom }}\right) in this case? Justify your answer.