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 can not solve halting problem. B 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 (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. L = {a^nb^n|n≥0}

32 The context-free languages are closed for:

(i) Intersection (ii) Union (iii) Complementation (iv) A (i) and (iv) B (i) and (iii) 7 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

C (ii) and (iv) D (ii) and (iii) Ans. (ii) and (iv)

33 Correct hierarchical relationship among context- free, right-linear, and context- sensitive language is A context-free ⊂ right-linear ⊂ context-sensitive B context-free ⊂ context-sensitive ⊂ right-linear C context-sensitive ⊂ right-inear ⊂context-free D right-linear ⊂context-free ⊂context-sensitive Ans. right-linear ⊂context-free ⊂context-sensitive

34 Which of the following CFG's can't be simulated by an FSM ? A S --> Sa | b B S --> aSb | ab C S --> abX, X --> cY, Y --> d | aX D None of these Ans. S --> aSb | ab

35 Grammars that can be translated to DFAs: A Left B Right linear grammar C Generic grammar D All of these Ans. Right linear grammar

36 The language accepted by a Push down Automata: A Type0 B Type1 C Type2 D Type3 Ans. Type2

8 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

37 P, Q, R are three languages, if P and R are regular and if PQ = R, then A Q has to be regular B Q cannot be regular C Q need not be regular D Q cannot be a CFL Ans. Q need not be regular

38 A class of language that is closed under A union and complementation has to be closed under intersection B intersection and complement has to be closed under union C union and intersection has to be closed under complementation D both (A) and (B) Ans. both (A) and (B)

39 The productions E—>E+E E—>E—E E-->E*E E —> E / E E —> id A generate an inherently ambiguous language B generate an ambiguous language but not inherently so C are unambiguous D can generate all possible fixed length valid computation for carrying out addition, subtraction, multipication and division, which can be expressed in one expression Ans. generate an ambiguous language but not inherently so

40 Which of the folowing definitions below generates the same language as L, where L = {xn yn such that n > = 1} ? I. E —> xEy | xy II. xy | (x+ xyy+) III .x+y A I only B I and II C II and III 9 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 II only Ans. I only

41 Following context free grammar S —> aB | bA A —>b | aS | bAA B —> b | bS | aBB generates strings of terminals that have A equal number of a's and b's B odd number of a's and odd number b's C even number of a's and even number of b's D odd number of a's and even number of a's Ans. equal number of a's and b's

42 Which of the following CFG's can't be simulated by an FSM ? A s ---> sa | a B s ---> abX , X --> cY, Y --> a | axY C s ---> a sb | ab D none of these Ans. s ---> a sb | ab

43 Basic limitation of FSM is that it A cannot remember arbitrary large amount of information B sometimes fails to recognize grammars that are regular C sometimes recognizes grammars are not regular D None of these Ans. cannot remember arbitrary large amount of information

44 Which of the following is not possible algorithmically ? A to context free grammar B Non-deterministic FSA to deterministic FSA C Non-deterministic PDA to deterministic PDA D None of these Ans. Non-deterministic PDA to deterministic PDA

10 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

45 Let L denotes the language generated by the grammar S – OSO/00. Which of the following is true? A L = O B L is regular but not O C L is context free but not regular D L is not context free Ans. L is regular but not O

46 Which of the following statements in true? A If a language is context free it can always be accepted by a deterministic push- down automaton B The union of two context free languages is context free C The intersection of two context free languages is context free D The complement of a context free language is context free Ans. The union of two context free languages is context free

47 Given an arbitrary non-deterministic finite automaton (NFA) with N states, the maximum number of states in an equivalent minimized DFA is at least. A N^2 B 2^N C 2N D N! Ans. 2^N

48 What is the complement of the language accepted by the NFA shown below? Assume ∑ = {a} and ε is the empty string

A Φ B ε

11 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

C a D {a, ε} Ans. ε

49 Given the language L = {ab, aa, baa}, whih of the following strings are in L*? ….1) abaabaaabaa ….2) aaaabaaaa ….3) baaaaabaaaab ….4) baaaaabaa A 1, 2 and 3 B 2, 3 and 4 C 1, 2 and 4 D 1, 3 and 4 Ans. 1, 2 and 4

50 Which of the following problems are decidable? ….1) Does a given program ever produce an output? ….2) If L is a context-free language, then is L’ (complement of L) also context- free? ….3) If L is a , then is L’ also regular? ….4) If L is a recursive language, then, is L’ also recursive? A 1, 2, 3, 4 B 1, 2, C 2, 3, 4 D 3, 4 Ans.

51 The lexical analysis for a modern language such as Java needs the power of which one of the following machine models in a necessary and sufficient sense? A Finite state automata B Deterministic pushdown automata C Non-deterministic pushdown automata D Turing machine Ans. Finite state automata

52 Which of the following pairs have DIFFERENT expressive power? 12 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

A Deterministic finite automata (DFA) and Non-Deterministic finite automata(NFA) B Deterministic push down automata (DPDA) and Non-deterministic pushdown automata C Deterministic single-tape Turing machine and Non-deterministic single-tape Turing Machine D Single-tape Turing machine and multi-tape Turing machine Ans. Deterministic push down automata (DPDA) and Non-deterministic pushdown automata

53 Consider the language L1,L2,L3 as given below. L1={0p1q | p,q ∈ N} L2={0p1q| p,q ∈ N and p=q} L3={0p1q0r | p,q,r ∈N and p=q=r} Which of the following statements is NOT TRUE? A Push Down Automata (PDA) can be used to recognize L1 and L2 B L1 is a regular language C All the three languages are context free D Turing machine can be used to recognize all the three languages Ans. All the three languages are context free

54 S –> aSa| bSb| a| b ;The language generated by the above grammar over the alphabet {a,b} is the set of A All palindromes. B All odd length palindromes. C Strings that begin and end with the same D All even length palindromes. Ans. All odd length palindromes.

55 Which one of the following languages over the alphabet {0,1} is described by the regular expression: (0+1)*0(0+1)*0(0+1)*? A The set of all strings containing the substring 00. B The set of all strings containing at most two 0’s. C The set of all strings containing at least two 0’s. D The set of all strings that begin and end with either 0 or 1. Ans. The set of all strings containing at least two 0’s.

13 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

56 Which one of the following is FALSE? A There is unique minimal DFA for every regular language B Every NFA can be converted to an equivalent PDA. C Complement of every context-free language is recursive. D Every nondeterministic PDA can be converted to an equivalent deterministic PDA. Ans. Every nondeterministic PDA can be converted to an equivalent deterministic PDA.

57 Match all items in Group 1 with correct options from those given in Group 2. Group 1 Group 2 P. Regular expression 1. Syntax analysis Q. Pushdown automata 2. Code generation R. Dataflow analysis 3. Lexical analysis S. Register allocation 4. Code optimization A P-4. Q-1, R-2, S-3 B P-3, Q-1, R-4, S-2 C P-3, Q-4, R-1, S-2 D P-2, Q-1, R-4, S-3 Ans. P-3, Q-1, R-4, S-2

58 Let L = L1 ∩ L2, where L1 and L2 are languages as defined below: L1 = {ambmcanbn | m, n >= 0 } L2 = {aibjck | i, j, k >= 0 } Then L is A Not recursive B Regular C Context free but not regular D Recursively enumerable but not context free. Ans. Context free but not regular

59 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*)* 14 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

C 0*(10*1*)*0* D 0*1(10*1)*10* Ans. 0*(10*10*)*

60 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

61 The CFG s---> as | bs | a | b is equivalent to regular expression A (a + b) B (a + b) (a + b)* C (a + b) (a + b) D None of these Ans. (a + b) (a + b)*

62 Consider the grammar : S —> ABCc | Abc BA —> AB Bb —> bb Ab —> ab Aa —> aa

Which of the following sentences can be derived by this grammar A abc B aab C abcc D abbb Ans. abc

15 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

63 Pumping lemma is generally used for proving that A given grammar is regular B given grammar is not regular C whether two given regular expressions are equivalent or not D None of these

Ans. given grammar is not regular

64 The language of all words with at least 2 a's can be described by the regular expression A (ab)*a and a (ba)* B (a + b)* ab* a (a + b)* C b* ab* a (a + b)* D all of these Ans. all of these

65 Any string of terminals that can be generated by the following CFG is S-> XY X--> aX | bX | a Y-> Ya | Yb | a A has atleast one 'b' B should end in a 'a' C has no consecutive a's or b's D has atleast two a's Ans. has atleast two a's

66 L = (an bn an | n = 1,2,3) is an example of a language that is A context free B not context free C not context free but whose complement is CF D both (b) and (c) Ans. both (b) and (c)

16 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

67 FSM can recognize A any grammar B only CG C Both (a) and ( b ) D only regular grammar Ans. only regular grammar

68 Set of regular languages over a given alphabet set is closed under A union B complementation C intersection D All of these Ans. All of these

69 Which of the following statement is correct? A All languages can not be generated by CFG B Any regular language has an equivalent CFG C Some non regular languages can't be generated by CFG D both (b) and (c) Ans. both (b) and (c)

70 If L1 and L2 are context free language and R a regular set, then which one of the languages below is not necessarily a context free language? A L1 L2 B L1 ∩ L2 C L1 ∩ R D L1 ∪ L2 Ans. L1 ∩ L2

71 Consider a grammar with the following productions

S--> aab | bac | aB S --> α S | b S --> α b b | ab Sα --> bdb | b 17 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

The above grammar is A Context free B Regular C context sensitive D LR ( k ) Ans. context sensitive

72 What can be said about a regular language L over {a} whose minimal finite state automation has two states? A L must be { an | n is odd} B L must be { an | n is even} C L must be {an | > 0} D Either L must be {an | n is odd}, or L must be {an | n is even} Ans. L must be { an | n is even}

73 In a context-sensitive grammar, number of grammar symbols on the left hand side of a production can't be greater than the number of A grammar symbols on the right hand side B terminals on the right hand side C non-terminals on the right hand side D all of these Ans. non-terminals on the right hand side

74 In a context-free grammar A ε can't be the right hand side of any production B terminal symbols can't be present in the left hand side of any production C number of grammar symbols in the left hand side is not greater than the number of grammar symbols in the right hand side D all of these Ans. all of these

75 CFG can be recognized by a A push-down automata B 2-way linear bounded automata 18 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

C both (a) and (b) D none of these Ans. both (a) and (b)

76 A given grammar is called ambiguous if A two or more productions have the same non-terminal on the left hand side B a derivation tree has more than one associated sentence C there is a sentence with more than one derivation tree corresponding to it D brackets are not present in the grammar Ans. there is a sentence with more than one derivation tree corresponding to it

77 The logic of pumping lemma is a good example of A pigeon-hole principle B divide-and-conquer technique C D iteration Ans. pigeon-hole principle

78 The intersection of CFL and regular language A is always regular B is always context free C both (a) and (b) D need not be regular Ans. is always context free

79 For two regular languages

L1 = (a + b)* a and L2 = b (a + b ) * , the intersection of L1 and L2 is given by A (a + b ) * ab B ab (a + b ) * C a ( a + b ) * b D b (a + b ) * a

19 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. b (a + b ) * a

80 For which of the following application, regular expressions can not be used ? A Designing computers B Designing compilers C Both (a) and (b) D Developing computers Ans. Both (a) and (b)

81 Which of the following statements is (are) correct ? A Recursive languages are closed under complementation. B If a language and its complement are both regular, the language is recursive C Set of recursively enumerable language is closed under union D All of these Ans. All of these

82 Which of the following statement is wrong ? A Any regular language has an equivalent context-free grammar. B Some non-regular languages can’t be generated by any context-free grammar C Intersection of context free language and a regular language is always context-free D All languages can be generated by context- free grammar Ans. All languages can be generated by context- free grammar

83 Consider a grammar :

G = ( { x , y ) , { s , x , y } , p , s)

where elements of parse :

S--> x y S -->y x x--> x z x--> x y--> y z--> z

20 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

A Chomsky type 0 B Chomsky type 1 C Chomsky type 2 D Chomsky type 3 Ans. Chomsky type 3

84 A grammar that produces more than one parse tree for some sentence is called A Ambiguous B Unambiguous C Regular D none of these Ans. none of these

85 If a language is denoted by a regular expression L = ( x )* (x | y x ) , then which of the following is not a legal string within L ? A yx B xyx C x D x y x y x Ans. x y x y x

86 If every string of a language can be determined, whether it is legal or illegal in finite time, the language is called A decidable B Undecidable C interpretive D non-deterministic Ans. decidable

87 The defining language for developing a formalism in which language definitions can be stated, is called A syntactic meta language B decidable language C intermediate language 21 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 high level language Ans. syntactic meta language

88 The main difference between a DFSA and an NDFSA is A in DFSA, ε transition may be present B in NDFSA, ε transitions may be present C in DFSA, from any given state, there can't be any alphabet leading to two diferent states D in NDFSA, from any given state, there can't be any alphabet leading to two diferent states Ans. in DFSA, from any given state, there can't be any alphabet leading to two diferent states

89 If e1 and e2 are the regular expressions denoting the languages L1 and L2 respectively, then which of the following is wrong ? A (e1) | (e2) is a regular expression denoting L1 ∪ L2 B (e1) .(e2) is a regular expression denoting L1. L2 C φ is not a regular expression D {ex} is a regular expression denoting L1* Ans. φ is not a regular expression

90 Context free language are closed under A union, intersection B union, kleene closure C intersection, complement D complement, kleene closure Ans. union, kleene closure

91 What is the highest type number which can be applied to the following grammar ? S —> Aa, A —> Ba, B —> abc A Type 0 B Type 1 C Type 2 D Type 3 Ans. Type 2 22 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

92 An FSM with A 1 stack is more powerful than an FSM with no stack B 2 stacks is more powerful than a FSM with 1 stack C both (a) and (b) D None of these Ans. both (a) and (b)

93 If two finite states machine M and N are isomorphic, then A M can be transformed to N, merely -labelling its states B M can be transformed to N, merely re-labelling its edges C Both (a) and (b) D None of these Ans. M can be transformed to N, merely re-labelling its states

94 Power of A DFSM and NDFSM are same B DFSM and NDFSM are different C DPDM and NDPDM are diferent D Both (A) and (C) Ans. Both (A) and (C)

95 An FSM can be used to add how many given integers ? A 1 B 3 C 4 D 2 Ans. 2

96 If two finite state machines are equivalent, they should have the same number of A States B Edges C states and edges D none of these 23 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. none of these

97 For which of the following applications regular expressions can be used ? A Designing compilers B Developing text editors C Simulating sequential circuits D All of these Ans. All of these

98 In an incompletely specified automata A no edge should be labelled epsilon B from any given state, there can't be any token leading to two different states C both (a) and (b) D start state may not be there Ans. start state may not be there

99 The word 'formal' in formal languages means A the symbols used have well-defined meaning B they are unnecessary, in reality C only form of the string of symbols is significant D Both (a) and (b) Ans. only form of the string of symbols is significant

100 Which of the following are not regular ? A String of 0's whose length is a perfect square B Set of all palindromes made up of 0's and 1's C Strings of 0's, whose length is a prime number D All of these Ans. All of these

24 Prepared By: Prof. Janvi P. Patel Prof. Bhoomi M. Bangoria Computer/IT Engineering