CS2004
CS2004
7. Are the class of Determisitic Context-free Languages closed under union? Justify 5 marks
your answer with a suitable example. (You may either give a formal proof that
DCFL’s are closed under union or give a counter example showing that they are
not closed. In the latter case, you must prove that the two input languages are DCFL
and prove that their union is not a DCFL. You may assume that an bn cn , n ≥ 1, is
not context free).
1
9. Consider the following grammar G = (V, T, R, S): 5 marks
V = {S, A, B} is the set of variables;
T = {a, b} is the set of terminals;
S is the start variable;
R is the set of production rules as given below.
S → ASA|aB
A → B|S
B → b|.
Convert G to an equivalent grammar H in Chomsky Normal Form.
10. (a) Prove that L10a = {ww : w ∈ {a, b}∗ } is not regular. 2.5 marks
(b) Write the context free grammar that generates the following language.
L10b = {ai bj ck : i, j, k ≥ 0, i = k or i = j}. 2.5 marks
−−F−−