CS2004
CS2004
Figure 1:
NITR/CSE/RKM/TKM/CS2004/END/2019
4. (a) Draw the state transition diagram of the language accepted by a DFA whose
equivalent PDA P = ({p, q}, {a, b}, {R, Z0 }, δ, q, Z0 ) if δ is given by: [4]
δ(q0 , b, Z0 ) = {(p, RZ0 )}
δ(p, a, R) = {(q0 , )}
δ(q0 , , Z0 ) = {(p, )}
(b) What is left recursive and right recursive grammars? With an example explain how
to convert a given left recursive grammar to its equivalent grammar without left
recursive productions. [4]
(c) Consider the grammar [2]
S → xSyS | SS | λ
What language does it generate?
5. (a) What do you mean by a context-free grammar? Explain with suitable examples,
how to eliminate -production, unit production and useless symbols from a
grammar. [4]
(b) Find a context free grammar with minimum number of production rules possible
for the language given below and also, construct the PDA. [4]
q m+n n p p+q q
{1 1 1 0 0 0 | m, n, p, q ≥ 0}
(c) Construct a deterministic finite automaton equivalent to the grammar [2]
S → aS|bS|aA
A → bB
B → aC
C →∈
———— END ————
NITR/CSE/RKM/TKM/CS2004/END/2019