Cst301 Flat Dec 2022
Cst301 Flat Dec 2022
PART A
(Answer all questions; each question corries 3 marles) Marks
Define t-closure of a state? Explain with example. J
Construct a DFA for strings in which first and last leffers do not match. a
J
I: {a, b}
Generate regular expression for strings in which number of a's is a multiple of
three.l={a,b}
4 Explain any 3 closure properties of regular languages J
TRACE KTU
a
5 With suitable example, explain about ambiguous grammar J
. -;:- PART B
(Answer onefull quationfrom each module, each question carries 14 morks)
Module -1 ,
Page 1 of 3
l1fficsT30tt22m2
Module -2
l3 a) Using pumping lemmf show that L= { dtf / n> 0 } is not regular 7
b) Develop equivalent automata for the Regular Expression (a+hf aabb|s*+bb)- 7
t4 a) Prove that for every Regular Expression 'R', there is an eNFA 'rlf' 7
b) List.out the rules for writing regular expressions. Convert the following DFA to
its equivalent Regular Expression
Module-3
o
15 a) What is Greibach Norrnal Form (GNF)? Convert the following CFG to GNF
S +AA/a, A+SS/b
b) a) Design CFG for the following languages
i-+Siql ':e2;
ii
:QL-*..ql ,q3. 7
ii,!
t42
- CNF. S+aSa/bSb/SS/€
Page 2 of 3
ilwcsT30rI22202
Module -4
17 a) Prove that for every PDA accEpted by final state, there exists an equivalent PDA
b) Design PDA for set of even length palindromes over {a, b}. Illustrate the working
7
ryithsuitable example
l8 a) Design PDA for Z= { x € fu, b}* / #o 1x) = fi (x) }.
7
Here #p (x,) represents tlre number of occurrences of the symbol p in the string x
b) Using pumping lemma for CFLs, show that I = { ww / w € {a, b}* } isnot context
7
free.
" Module -5
19 a) Design TM for 1 = {atrbnao / m, n > 0}. Illustrate the working with suitable
-ii 7
example
b) Explain Chomsky hierarchy for formal languages and evaluate various typcs 7
20 a) Design a TM to copy a sking of a's and b's to the right side, leaving one blank
symbol (b) in between. Assume that initially the input tape contains bxb and TM 7
halts with.bxbxb as the ape content. x € {a, b}*
b) undecidable
TRACE KTU
Prove that TM halting problem is 7
***
Page 3 of 3