Toc Cie Papers
Toc Cie Papers
-v
"1-.,.,.,r vt '-ov""
R V College of Engineering
Department of Computer Science and Engineering
TEST - I : Question Paper
Subject:
(Code)
Theory of Computation
(16CS46)
ISemester: 4 th
B _E
I.a Define regular expression. Give regular expression which generates the Ll ,L3 COl
4 L2 Co2
3.a For the DFA given beloyy.~ how that there cannot be any other DFA with fewer
states accepting the same languagn b
0-- ce
(U
b
3.b Use Kleen's theorem part-II to find a regular expression corresponds to the DFA 6 L3 COJ
below.
4.a State and prove pumping lemma for regular languages. Using pumping lemma 6 u Co4
for regular sets show that the language below is not regular.
L={ xy I x, ye {O, I}* and y = x'}.
4.b Let Ml and M2 be the DFAs as shown below, accepting languages LI and L2, LJ COJ
5.a Describe the decision algorithms to answer the following questions. L2 Col
5.b Define CFG, Language generated by CFG and Ambiguity in CFG . Describe the LI CO2
S.c Define null productions and unit productions. For the CFG below find an 4 L4 C04
equivalent CFG with no null productions and no unit productions that generates
the same language, except possibly fore.
ABC, BC a €, CB b € , AB I A IC
R V College of Engineering
Department of CSE
TEST - II : Question Pa er
Subject: Theory ofComputation-16CS46 Semester: 4 th BE
(Code)
Date :March~2019 Duration : 90 minutes Staff: HKK/AS!MRA/SSV
Name: USN: Section : A/B/C/D
fY
L< [OJ
Define GNF grammar. Given below a CFG G, find a CFG G 1 in GNF geverating
L(G)-{ e }.
S->AB I AC, A->aAb I bAa I a, B->bbA I aaB I AB, C->abCa I aDb, D->bDJaC
I ,Y.b Show that every regular language is also a context free language. 2 LI COi
L2 Co2
· Define PDA. Design PDA to accept each of the following languages. You may
accept either by final state or by empty stack, whichever is convenient.
i. L=f0°1 ° I n>O l ii. L=faiJ>iJ I i=i or Pi((
LI C"ll.\
2.b Let L be L(Ml) for some PDA with final state Ml=(Q,I;,f,o,qo,Zo,F), prove that
there exists an empty stack PDA M2 such that L=L(M2). Construct final state
PDA to accept L={ailJi/ I i#j or j;tk}. Convert it into equivalent empty stack
PDA. .
3.a. 2 L2 CO2
Show that every regular grammars are linear grammars but every linear
1rrammars are need not be reirular 1ITammars.
3.b. How to find an equivalent CFG from a given PDA. Find the equivalent CFG to 8 L4 COi
the PDA whose transition diagram is shown below. Show that the string aba1aba
is acce\ted by the PDA and it is generated by the equivalent CFG.
o.,-i:\~ .
.
___, .
.oL,
. _- r>;c I?::. a' ·1
.-V bo..' a_a.. I1a...c...
e
°-1!>l E: '
b1J,;, \ b.b .
IA
4.a. State and prove pumping lemma for context free languages.
Show that L=f ww I w E fa,b l *l is not context free.
Ll COJ
4.b. IfLI is a context free language and L2 is a regular language, then prove that
d:~
LI nL2 is a context free lanirua!!e.
COJ
5.a ·Give the equivalent left linear grammar to the finite automata whose transition L4
0--
5.b Draw the NFA accepting the language generated by the grammar with L2 CO:?
aS1b,
COURSE OUTCOMES:
• - = - - -- -
i LI L2 L3 L4 i 15 L6 COi CO2 C03 C04
/ Total 8 14, 12 16 - 12 14 12 12
Marks I-