Siddhivinayak Technical Campus School of Engineering & Research Technology Department of computer science and Engineering Session 2016-2017 Subject Name- Theory of Computation Subject Code-4KS05 Sr No. UNIT I Question Bank 1. Design a DFA that contain a set of all string containing 1bb as a substring over ={1,b} 2. Construct DFA to accept the following languages Over alphabet (0,1 I. (i)the set of all strings ended with 011 (ii)the set of all strings which do not Contain three consecutive 0 s. Marks 3. Define DFA. Construct DFA for set of string over{a,b,c} having bca as substring 4. Convert following NFA into DFA δ a b q 0 q 0, q 1 q 1 q 1 q 2 q 2 *q 2 q 2,q 3 q 2 q 3 q 2 Ф 5. Construct a deterministic automata(dfa) equivalent to NFA M=({q 0, q 1 },{0,1},δ,q 0, {q 0 }} whose transition diagram is given below Q 0 1 ->(q 0) q 0 q 1 q 1 q 1 {q 0,q 1 } 6. Construct a deterministic automata equivalent to NFA, M=({q 0,q 1,q 2,q 3 },{a,b},δ,q 0, {q 3 }) Where δ is defined by its state table. Q 0 1 ->q 0 q 0, q 1 q 0 q 1 q 2 q 1 q 2 q 3 q 3 (q 3) Ø q 2 7. Prove that if L is accepted by an NFA, then there exists a DFA that accepts L 04 8. Covert the following NFA with transitions to equivalent NFA without
transitions for following diagram 9. Find equivalent NFA without transitions for following diagram 05 10. Construct Moore machine from following mealy machine 11. Construct Moore machine from following mealy machine 12. Construct Moore machine to convert each occurrence of substring 100 by101 13. Design a Moore machine to determine residue mod 2 for each binary string treated as binary integer.
14. Design a Moore machine to determine residue mod 3 for each binary string treated as binary integer. 15. Convert the following Mealy machine to Moore machine Input a Input b Present State Next State Output Next State Output q 1 q 3 0 q 2 0 q 2 q 1 1 q 4 0 q 3 q 2 1 q 1 1 q 4 q 4 1 q 3 0 16. Design a Moore Machine for binary input Sequence,if it ends in 101, output is A, if itends in 110 output is B otherwise C. 17. Construct NFA which accepts all prefix of string aab. 18. Minimize the following DFA δ 0 1 q 0 q 1 q 5 q 1 q 6 q 2 *q 2 q 6 q 2 q 3 q 2 q 6 *q 4 q 5 q 7 q 5 q 2 q 6 q 6 q 6 q 4 q 7 q 6 q 2 19. Construct the minimum state automation equivalent to following FA whose transition table is Q 0 1 13 13 q 0 q 1 q 2 q 1 q 4 q 3 q 2 q 4 q 3 (q 3) q 5 q 6 (q 4) q 7 q 6 q 5 q 3 q 6 q 6 q 6 q 6 q 7 q 4 q 6 20. Convert following RE into FA : 10+(0+11)0*1 UNIT- II 1. Construct the regular expression corresponding to state diagram described by 05
2. Construct the regular expression for given transition diagram 05 3. Construct the regular expression for given transition diagram 05 4. Construct the regular expression for given transition diagram 5. Show that the following language are Regular or not: i) L={a p /P is prime} ii) L={ ώώ / ώ is (a,b)* } 6. Design Finite Automata without transitions for the regular expression((a+b)*de)* 05 7. State and explain the pumping lemma with an example. What is its application? 8. Using pumping lemma show that the following language are not regular: i) L={0 i2 /I is an integer i>=1} ii) L={0 i 1 i /i>=1} 9. Let G={ [A 0, A 1 ], [a, b], P, A 0 } where P consist of A 0 ->aa 1 A 1 ->ba 1 A 1 ->a A 1 ->ba 0 Construct Transition system M accepting L(G) 10. Find Right and Left Linear grammer for: i) 0 * (1(0+1)) * ii) (((01+10) * 11) * 00 ) * 11. Find Right and Left Linear grammer for:
L={a n b m /n>=2,m>=3} 12. Write the regular expression for the language: i) L={a n b m /(n+m) is even} ii) For the set of strings with even no of 0 s followed by odd number of 1 s for the language L={0 2n 1 2m+1 /n>=0,m>=0} 13. Explain in brief the closure properties of regular sets. UNIT III 1. Write a CFG to generate the language L= {0 m 1 n 0 m+n /m,n>=1}, 2. Convert the following grammar into CNF: S->abAB, A->bAB / Є, B->Baa/A/Є 3. Construct a PDA for the language. (i) L= {ww R / w is in (0+1)*} (ii) L= {a 2n cb n / n>=1} 4. (b)convert the following to GNF:[] G= ({A 1, A 2, A 3 }, {a, b}, P, A 1 ) where P consist of A 1 ->A 2 A 3, A2->A 3 A 1 /b, A3->A 1 A 2 /a 5. Construct Turing Machine that accepts the following Language on {a,b} (i) L= {aba*b}. (ii) L= {w: w is even} 6. Explain the properties of CFLs. 7. Eliminate null production, unit production, useless production, from the following grammer (i) S->aS/A/c A->a B->aa C->acb (ii) S->a/aA/B/C A->aB/ Є B->Aa C->aCD D->ddd 8. Let G=<V,T,P,S> be a grammer whose productions are: S->aB/bA A-> a/as/baa B->b/bSaBB For the string aaabbabbba,find i) Left most derivation ii) Right most derivation iii) Parse tree for each derivation
UNIT IV 1. Explain in brief different types of turning machine. 2. Explain in brief Multi dimentional turing machine 05 3. Explain in brief i) Multitape turing machine ii) Two way infinite tape turing machine 4. Design a Turning Machine to compute the multiplication of two numbers. 5. Construct Turing Machine that accepts the following Language on {a, b} i) L= {aba*b}. ii) L= {w: w is even}. 6. Explain in brief Church s Hypothesis. 7. Design a Turing Machine that computes 09 f(x,y)= x-y if x>=y = 0 if x<y 8. Construct a Turing Machine that recognize a language {a n b n c n /n>=0} 9. Construct a Turing Machine that recognize a language {a n b n c n /n>=1} 10. Construct a Turing Machine that recognize a language {0 n 1 n /n>=0} 11. Construct a Turing Machine that recognize a language {0 n 1 n /n>=1} 12. Design a Turing Machine that computes the function f(m,n)=m+n 13. Design a Turing Machine that computes the function f(m,n)=m*n Or Design a Turning Machine to compute the multiplication of two numbers. UNIT V 1. Define Linear bounded automation 03 2. Find Linear bounded automation that accepts the language L={a n! /n>=0} 3. Find Linear bounded automation that accepts the language L={WW/W ɛ (a,b)*} 4. Give (LR/0) grammar for the following production S ->Sc S->SA/A A->aSb/ab 5. Find the grammer generating the set accepted by LBA whose transition table is as follows: 6. Explain the closure property of DCFL s 7. Explain following grammer in detail : i) Type 0 ii) Type 1 iii) Type 2
iv) Type 3 8. Explain the Chomsky Hierarchy?Explain with example? 9. Show that L={Wɛ{a,b}*:n a (W) n b (W)}is a deterministic context free 10. Show that the languages. 10 i) L 1 ={0 n 1 m /n=m and n>=1} ii) L 2= {0 n 1 m /n=2m and n>=1} is a deterministic context free-language 11. Show that L={a n b n / n>=1}u {a}is a deterministic. If yes construct DPDA for it 05 12. Show that there exists some LBA M, for every context sensitive language L not including Such that L=(L) 13. Give unrestricted context sensitive grammer for: L={a i b i c i /i>=1} 14. Show that the family of context sensitive languages is closed under reversal UNIT- VI 1. Prove the following i) The complement of recursive language is recursive. ii) The Union of two recursive language is recursive. 2. Describe in brief what is halting problem 3. Prove that the Turing Machine M halts on input W is undecidable. 4. Explain the properties of recursive and recursively enumerable languages in detail 5. Explain Universal turing machine 6. Determine whether the following pairs (A, B) have a solution or not, if yes give solution, if no why? 7. Determine whether the following pairs (A, B) have a solution or not, if yes give solution, if no why? i) A={1,10111,10} B={111,10,0} ii) A={10,011,101} B={101,11,011} 8. Show that the following function are recursive: i) n+m ii) nm 9. Show that the addition and multiplication of two positive integers is total recursive function. 10. Does the PCP with two lists x=(b,bab 3,ba) y=(b,baa) have a solution?