Sie sind auf Seite 1von 2

www.rejinpaul.

com
Roll. NO

TJ INSTITUTE OF TECHNOLOGY, CHENNAI 600 097. DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
MODEL TEST Sub. Code : CS 2303 Sub. Name : Theory of Computation Date : Max. Marks : Duration : Year : 10.10.2011. 100 3 Hours III

Answer All Questions 1 2

PART A (10 x 2 = 20 Marks)

What is a finite automaton? Give two examples. 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?

m m o o c c . . l l u u a a p p n n i i j j e e r r . . w w w w w w
S->aB/bA S/bAA A->a/a 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. M= ({p,q,r},{0,1}, ,p,{q,s}) Where is defined in the following table. p q r s 0 {q,s} {r} {s} 1 {q} {q,r} {p} {p} (8) ii) If L is accepted by an NFA with -transition then show that L is accepted by an NFA without -transition. (8) (OR)

5.

Let G be the grammar

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.
2

www.rejinpaul.com

(8)

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

(OR) b) i) Show that the regular languages are closed under intersectionand reversal.
n2/n

(8) (8)

ii) Show that the set L={O

is an integer,n>=1} is not regular.

13) a) i) Let G be a CFG and let a=>w in G. Then show that there is a leftmost derivation of w.
n m n

m m o o c c . . l l u u a a p p n n i i j j e e r r . . w w w w w w
(8) ii)Construct a PDA accepting {a b a /m,n>=1} by empty stack. Also construct the corresponding context-free grammar accepting the same set. (OR) (8) b)Construct a Context free grammar G which accepts N(M), where M=({q 0, q1},{a,b},{z0,z},,q0,z0, q1) and where is given by (16) (q0,b, z0)={( q0,zz0)} (q0, , z0)={( q0, )} (q0,b,z)={( q0,zz)} (q0,a,z)={( q1,z)} (q1,b,z)={( q1, )} (q1,a, z0)={( q0, z0)} 14 a) i) Convert the grammar S->AB A->BS | b B->SA|a into Greibach NormalForm. 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) (OR) b) Define Turing machine for computing f(m,n)=m-n ( proper subtraction). (8) (8) (16) (16) (OR) b) Prove that the universal language Lu is recursively enumerable. (16)

15 a) Define the universal language and show that it is recursively enumerable but not recursive.

Das könnte Ihnen auch gefallen