2019 Dec. CS301-E - Ktu Qbank
2019 Dec. CS301-E - Ktu Qbank
2019 Dec. CS301-E - Ktu Qbank
PART A
Answer all questions, each carries 3 marks. Marks
1 Define nondeterministic finite automata(NFA). Draw the NFA for the language 3
L={an b m | n, m>=1}
2 Convert the following NFA to DFA. 3
P1 P2 P1
P2 P3 P1
*P3 P3 P4
*P4 P5 P4
Page 1 of 3
*P5 P3 P4
b) Which of the following operations are closed under regular sets. Justify your 4.5
answer.
i) Complementation ii) Set difference iii) string reversal iv) Intersection
13 a) Give a CFG for the language N(M) where M = ({p,q,r}, {0, 1}, {Z, X0}, 4.5
δ, q0, Z, r) and δ is given by δ(p , ϵ , X0) = {(q, ZX0)}, δ(q , ϵ , X0) = {(r, ϵ)}, δ(q
, 1, Z) = {(q, ZZ)}, δ(q , 0, Z) = {(q, ϵ)}.
b) Find the Greibach normal form grammar equivalent to the following CFG: 4.5
S → AB
A → BS| 1
B → SA|0
14 a) Design a PDA to accept the language {02n1n | n ≥ 1}. 4.5
b) Find a CFG without ϵ-productions equivalent to the grammar defined by 4.5
S → ABaC, A→BC, B→b/ ϵ, C→D/ ϵ , D→d
PART E
Answer any four full questions, each carries 10 marks.
15 a) State Pumping lemma for CFLs. Write the applications of pumping lemma for 4
CFL s.
b) Check whether L={aibici | i > 0} belong to CFL or not. 6
16 a) Discuss about Multitape Turing Machines. Explain informally how they can 5
Page 2 of 3
Page 3 of 3