Cs2303 Toc Model

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

w

w
w
.
r
e
j
i
n
p
a
u
l
.
c
o
m
w
w
w
.
r
e
j
i
n
p
a
u
l
.
c
o
m
Roll. NO


TJ INSTITUTE OF TECHNOLOGY, CHENNAI 600 097.
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

MODEL TEST Date : 10.10.2011.
Sub. Code : CS 2303 Max. Marks : 100
Sub. Name : Theory of Computation Duration : 3 Hours
Year : III

Answer All Questions PART A (10 x 2 = 20 Marks)

1 What is a finite automaton? Give two examples.
2 Give the DFA accepting the language over the alphabet 0,1 that have the set of
all strings with 011 as a substring.
3. Prove that if L and M are regular languages then so is LUM.
4. What is meant by equivalent states in DFA?
5. Let G be the grammar
S->aB/bA A->a/a
S/bAA B->b/bS/aBB.
Obtain parse tree for the string aaabbabbba.
6. Define the language generated by a PDA using the two methods of accepting a
Language
7. what do you mean by CNF and GNF
8. Explain the Basic Turing Machine model and explain in one move. What are the actions take
place in TM?
9. Show that the union of recursive language is recursive.
10. Define recursively enumerable language.
Answer All Questions PART B [5 x 16 = 80 Marks]

11. a) i)Construct a DFA equivalent to the NFA. (8)
M= ({p,q,r},{0,1}, ,p,{q,s})
Where is defined in the following table.

0 1
p {q,s} {q}
q {r} {q,r}
r {s} {p}
s - {p}

ii) If L is accepted by an NFA with -transition then show that L is accepted by an NFA
without -transition. (8)
(OR)

www.rejinpaul.com
www.rejinpaul.com
w
w
w
.
r
e
j
i
n
p
a
u
l
.
c
o
m
w
w
w
.
r
e
j
i
n
p
a
u
l
.
c
o
m
11 b) i) Let L be a set accepted by a NFA then show that there exists a DFA that accepts L. (8)
ii)Let L be a set accepted by an NFA.Then prove that there exists a deterministic finite
automaton that accepts L.Is the converse true? Justify your answer. (8)

12) a) Find the regular expression for the set of all strings denoted by R
2
13 from the deterministic
finite automata given below: (16)

(OR)
b) i) Show that the regular languages are closed under intersectionand reversal. (8)
ii) Show that the set L={O
n2/n
is an integer,n>=1} is not regular. (8)

13) a) i) Let G be a CFG and let a=>w in G. Then show that there is a leftmost
derivation of w. (8)
ii)Construct a PDA accepting {a
n
b
m
a
n
/m,n>=1} by empty stack. Also
construct the corresponding context-free grammar accepting the same set. (8)

(OR)
b)Construct a Context free grammar G which accepts N(M), where M=({q
0
,
q
1
},{a,b},{z
0
,z},,q
0
,z
0
, q
1
) and where is given by (16)
(q
0
,b, z
0
)={( q
0
,zz
0
)}
(q
0
, , z
0
)={( q
0
, )}
(q
0
,b,z)={( q
0
,zz)}
(q
0
,a,z)={( q
1
,z)}
(q
1
,b,z)={( q
1
, )}
(q
1
,a, z
0
)={( q
0
, z
0
)}
14 a) i) Convert the grammar
S->AB
A->BS | b
B->SA|a into Greibach NormalForm. (8)
ii)Construct a equivalent grammar G in CNF for the grammar G1 where
G1 =({S,A,B},{a,b},{S->bA|aB , A->bAA|aS|a , B->aBB|bS|b} ,S) (8)
(OR)
b) Define Turing machine for computing f(m,n)=m-n ( proper subtraction). (16)
15 a) Define the universal language and show that it is recursively enumerable but not
recursive. (16)

(OR)

b) Prove that the universal language Lu is recursively enumerable. (16)

www.rejinpaul.com
www.rejinpaul.com

You might also like