Faculty of Degree Engineering - 083 Department of CE / IT – 07 / 16 Multiple Choice Questions Bank Theory of Computation 2160704
Total Page:16
File Type:pdf, Size:1020Kb
Faculty of Degree Engineering - 083 Department of CE / IT – 07 / 16 Multiple Choice Questions Bank Theory Of Computation 2160704 1 Let R1 and R2 be regular sets defined over alphabet ∑ then A R1 UNION R2 is regular B R1 INTERSECTION R2 is regular C ∑ INTERSECTION R2 IS NOT REGULAR D R2* IS NOT REGULAR Ans. R1 UNION R2 is regular 2 Consider the production of the grammar S->AA A->aa A->bb Describe the language specified by the production grammar. A L = {aaaa,aabb,bbaa,bbbb} B L = {abab,abaa,aaab,baaa} C L = {aaab,baba,bbaa,bbbb} D L = {aaaa,abab,bbaa,aaab} Ans. L = {aaaa,aabb,bbaa,bbbb} 3 Give a production grammar that specified language L = {ai b2i >= 1} A {S->aSbb,S->abb} B {S->aSb, S->b} C {S->aA,S->b,A->b} D None of the above Ans. {S->aSbb,S->abb} 4 Which of the following String can be obtained by the language L = {ai b2i / i >=1} A aaabbbbbb B aabbb C abbabbba D aaaabbbabb. Ans. aaabbbbbb 5 Give a production grammar for the language L = {x/x ∈ (a,b)*, the number of a’s in x is multiple of 3}. A {S->bS,S->b,S->aA,S->bA,A->aB,B->bB,B->aS,S->a} B {S->aS,S->bA,A->bB,B->bBa,B->bB} C {S->aaS,S->bbA,A->bB,B->ba} 1 Prepared By: Prof. Janvi P. Patel Prof. Bhoomi M. Bangoria Computer/IT Engineering Faculty of Degree Engineering - 083 Department of CE / IT – 07 / 16 Multiple Choice Questions Bank Theory Of Computation 2160704 D None of the above Ans. {S->bS,S->b,S->aA,S->bA,A->aB,B->bB,B->aS,S->a} 6 The production Grammar is {S->aSbb,S->abb} is A type-3 grammar B type-2 grammar C type-1 grammar D type-0 grammar Ans. type-2 grammar 7 Which of the following statement is wrong? A A Turing Machine can not solve halting problem. B Set of recursively enumerable languages is closed under union. C A Finite State Machine with 3 stacks is more powerful than Finite State Machine with 2 stacks D Context Sensitive grammar can be recognized by a linearly bounded memory machine. Ans. A Finite State Machine with 3 stacks is more powerful than Finite State Machine with 2 stacks 8 Which of the following statement is wrong? A Recursive languages are closed under union. B Recursive languages are closed under complementation. C If a language and its complement are both regular then the language must be recursive. D A language is accepted by FA if and only if it is recursive Ans. A language is accepted by FA if and only if it is recursive 9 Which of the following statement is wrong? A Every recursive language is recursively enumerable B A language is accepted by FA if and only if it is context free. C Recursive languages are closed under intersection D A language is accepted by a FA if and only if it is right linear. Ans. A language is accepted by FA if and only if it is context free. 2 Prepared By: Prof. Janvi P. Patel Prof. Bhoomi M. Bangoria Computer/IT Engineering Faculty of Degree Engineering - 083 Department of CE / IT – 07 / 16 Multiple Choice Questions Bank Theory Of Computation 2160704 10 Which of the following statement is true? A All languages can be generated by CFG B The number of symbols necessary to simulate a Turing Machine(TM) with m symbols and n states is mn. C Any regular languages has an equivalent CFG. D The class of CFG is not closed under union. Ans. Any regular languages has an equivalent CFG. 11 Recursively enumerable languages are not closed under A Complementation B Union C Intersection D None of the above Ans. Complementation 12 Regular expression (x/y)(x/y) denotes the set A {xy,xy} B {xx,xy,yx,yy} C {x,y} D {x,y,xy} Ans. {xx,xy,yx,yy} 13 Regular expression x/y denotes the set A {x,y} B {xy} C {x} D {y} Ans. {x,y} 14 The regular expression denote a language comprising all possible strings of even length over the alphabet (0,1) A 1 + 0(1+0)* B (0+1)(1+0)* C (1+0) D (00+0111+10)* 3 Prepared By: Prof. Janvi P. Patel Prof. Bhoomi M. Bangoria Computer/IT Engineering Faculty of Degree Engineering - 083 Department of CE / IT – 07 / 16 Multiple Choice Questions Bank Theory Of Computation 2160704 Ans. (00+0111+10)* 15 The regular expressions denote zero or more instances of an x or y is A (x+y) B (x+y)* C (x* + y) D (xy)* Ans. (x+y)* 16 The regular expression have all strings in which any number of 0′s is followed by any number of 1′s followed by any number of 2′s is : A (0+1+2)* B 0*1*2* C 0* + 1 + 2 D (0+1)*2* Ans. 0*1*2* 17 The regular expression have all strings of 0′s and 1′s with no two consecutive 0′s is : A (0+1) B (0+1)* C (0+∈) (1+10)* D (0+1)* 011 Ans. (0+∈) (1+10)* 18 The regular expression with all strings of 0′s and 1′s with atleast two consecutive 0′s, is A 1 + (10)* B (0+1)*00(0+1)* C (0+1)*011 D 0*1*2* Ans. (0+1)*00(0+1)* 19 Which of the following is NOT the set of regular expression R = (ab + abb)* bbab A ababbbbab 4 Prepared By: Prof. Janvi P. Patel Prof. Bhoomi M. Bangoria Computer/IT Engineering Faculty of Degree Engineering - 083 Department of CE / IT – 07 / 16 Multiple Choice Questions Bank Theory Of Computation 2160704 B abbbab C ababbabbbab D abababab Ans. abababab 20 Which string can be generated by S->aS/bA, A->d/ccA A aabccd B adabcca C abcca D abababd Ans. aabccd 21 The regular sets are closed under A Union B Concenteration C Kleen closure D All of the above Ans. All of the above 22 Which of the following statement is wrong? A the regular sets are closed under intersection B the class of regular sets is closed under substitution C the class of regular sets is closed under substitution D Context Sensitive Grammar(CSG) can be recognized by Finite State Machine Ans. Context Sensitive Grammar(CSG) can be recognized by Finite State Machine 23 A FSM can be considered, having finite tape length without rewinding capability and unidirectional tape movement A Turing machine B Pushdown automata C Context free languages D Regular languages Ans. Turing machine 5 Prepared By: Prof. Janvi P. Patel Prof. Bhoomi M. Bangoria Computer/IT Engineering Faculty of Degree Engineering - 083 Department of CE / IT – 07 / 16 Multiple Choice Questions Bank Theory Of Computation 2160704 24 Any given transition graph has an equivalent A regular B DFSM (Deterministic Finite State Machine) C NDFSM D All of them Ans. All of them 25 The intersection of CFL and regular languages A is always regular B is always context-free C both option 1 and option 2 above D need not be regular Ans. both option 1 and option 2 above 26 Let L={w ∈ (0 + 1)*|w has even number of 1s}, i.e. L is the set of all bit strings with even number of 1s. Which one of the regular expression below represents L? A (0*10*1)* B 0*(10*10*)* C 0*(10*1*)*0* D 0*1(10*1)*10* Ans. 0*(10*10*)* 27 Let L1 be a recursive language. Let L2 and L3 be languages that are recursively enumerable but not recursive. Which of the following statements is not necessarily true? A L2 – L1 is recursively enumerable. B L1 – L3 is recursively enumberable C L2 ∩ L1 is recursively enumberable D L2 ∪ L1 is recursively enumberable Ans. L1 – L3 is recursively enumberable 28 Consider the languages L1={0i1j | i != j}, L2={0i1j | i = j}, L3 = {0i1j | i = 2j+1}, L4 = {0i1j | i != 2j}. Which one of the following statements is true? A Only L2 is context free B Only L2 and L3 are context free C Only L1 and L2 are context free 6 Prepared By: Prof. Janvi P. Patel Prof. Bhoomi M. Bangoria Computer/IT Engineering Faculty of Degree Engineering - 083 Department of CE / IT – 07 / 16 Multiple Choice Questions Bank Theory Of Computation 2160704 D All are context free Ans. All are context free 29 Let w be any string of length n is {0,1}*. Let L be the set of all substrings of w. What is the minimum number of states in a non-deterministic finite automaton that accepts L? A n-1 B n C n+1 D 2n-1 Ans. n-1 30 Which of the following is not true? A Power of deterministic automata is equivalent to power of non-deterministic automata. B Power of deterministic pushdown automata is equivalent to power of non- deterministic pushdown automata. C Power of deterministic Turing machine is equivalent to power of non-deterministic Turing machine. D All the above Ans. Power of deterministic pushdown automata is equivalent to power of non- deterministic pushdown automata. 31 Identify the language which is not context - free. A L = {ωωR|ωϵ{0,1}*} B L = {a^nb^n|n≥0} C L = {ωω|ωϵ{0,1}*} D L = {a^nb^mc^md^n | n, m≥0 } Ans.