Quiznetik

Theory of Computation | Set 1

1. = ∈{ } w has at least as many occurrences of (110)’s as (011)’s}. Let L {w 0,1 * 2 = ∈{ } w has at least as many occurrence of (000)’s as (111)’s}. Which one of the following is TRUE?

Correct : B. L2 is regular but not L1

2. A spanning tree for a simple graph of order 24 has

Correct : C. 23 edges

3. If G is a simple connected 3-regular planar graph where every region is bounded by exactly 3 edges, then the edges of G is

Correct : C. 6

4. If G is a connected planar graph of v vertices e edges and r regions then

Correct : A. v-e+r=2

5. A Hamiltonian cycle in a Hamiltonian graph of order 24 has

Correct : B. 24 edges

6. If G is a simple connected 3-regular planar graph where every region is bounded by exactly 3 edges, then the edges of G is

Correct : C. 6

7. The following grammar G = (N, T, P, S) N = {S, A, B} T = {a, b, c} P : S → aSa S → aAa A → bB B → bB B → c is

Correct : B. is type 2 but not type 3

8. The following grammar G = (N, T, P, S) N = {S, A, B, C, D, E} T = {a, b, c} P : S → aAB AB → CD CD → CE C → aC C → b bE → bc is

Correct : C. is type 1 but not type 2

9. The following grammar G = (N, T, P, S) N = {S, A, B, C} T = {a, b, c} P : S → aS A → bB B → cC C → a is

Correct : A. is type 3

10. P, Q, R are three languages. If P & R are regular and if PQ=R, then

Correct : C. Q need not be regular

11. Which of the following is true with respect to Kleene’s theorem? 1 A regular language is accepted by a finite automaton. 2 Every language is accepted by a finite automaton or a turingmachine.

Correct : C. Both 1 and 2 are true statements

12. Automaton accepting the regular expression of any number of a ' s is:

Correct : A. a*

13. Grammars that can be translated to DFAs:

Correct : B. Right linear grammar

14. Two strings x and y are indistinguishable if:

Correct : C. Both above statements are true

15. Given an arbitrary non-deterministic finite automaton NFA with N states, the maximum number of states in an equivalent minimized DFA is at least:

Correct : C. 2N

16. Regular expressions are

Correct : A. Type 0 language

17. The regular expression 0*(10)* denotes the same set as

Correct : B. 0+(0+10)*

18. Consider the NFA M shown below. Let the language accepted by M be L. Let L1 be the language accepted by the NFA M1, obtained by changing the accepting state of M to a non-accepting state and by changing the non-accepting state of M to accepting states. Which of the following statements is true?

Correct : A. L1 = {0,1}* − L

19. Which of the statements is true:

Correct : C. Both of the above are true statements

20. The regular sets are closed under:

Correct : D. All of the above

21. Any given transition graph has an equivalent:

Correct : D. All of them

22. A language is regular if and only if

Correct : A. Accepted by DFA

23. Which of the following is not a regular expression?

Correct : B. [(0+1)-(0b+a1)*(a+b)]*

24. Consider the regular language L = (111+111111)*. The minimum number of states inany DFA accepting this language is

Correct : D. 9

25. How many strings of length less than 4 contains the language described by the regular expression (x+y)*y(a+ab)*?

Correct : D. 11

26. Which of the following is TRUE?

Correct : B. Every finite subset of a non-regular set is regular

27. The minimum state automaton equivalent to the above FSA has the following number of states

Correct : B. 2

28. 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)*?

Correct : C. The set of all strings containing at least two 0’s.

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?

Correct : C. n+1

30. Which of the following are regular sets?

Correct : A. I and IV only

31. A minimum state deterministic finite automation accepting the language L={W W ε {0,1}*, number of 0s and 1s in are divisible by 3 and 5, respectively} has

Correct : A. 15 states

32. Let P be a regular language and Q be context-free language such that Q ∈ P. (For example, let P be the language represented by the regular expression p*q* and Q be {pnqn n∈ N}). Then which of the following is ALWAYS regular?

Correct : C. ∑* – P

33. Given a Non-deterministic Finite Automation (NFA) with states p and r as initial and final states respectively and transition table as given below: A B P - Q q R S r R S s R S The minimum number of states required in Deterministic Finite Automation (DFA) equivalent to NFA is

Correct : C. 3

34. Which one of the following statement is true for a regular language L over {a} whose minimal finite state automation has two states?

Correct : A. L must be either {an I n is odd} or {an I n is even}

35. The …………. is said to be ambiguous if there exist at least one word of its language that can be generated by the different production tree .

Correct : B. CFG

36. Type-1 Grammar is known as_____________

Correct : B. CSG

37. If G is “S → a S/a”, then L(G) = ?

Correct : C. {a}+

38. “S →a S”, what is the type of this production?

Correct : D. Type 3

39. A→abA a type __________productions

Correct : B. Type 1

40. The following CFG is in S → AB**spaceB → CD**spaceB → AD**spaceB → b**spaceD → AD**spaceD → d**spaceA → a**spaceC → a

Correct : C. Strong Chomsky normal form

41. The language accepted by a Push down Automata:

Correct : C. Type2

42. Which of the following problems is undecidable?

Correct : B. Ambiguity problem for CFGs

43. Which one of the following statement is FALSE?

Correct : C. context-free languages are closed under intersection

44. Which of the following statement is wrong?

Correct : D. All non-regular languages can be generated by CFGs.

45. Which of the following strings is not generated by the following grammar? S → SaSbS ε

Correct : D. aaabb

46. Which of the following regular expression identity is true?

Correct : B. (r*s*)* = (r + s)*

47. A language L is accepted by a FSA iff it is

Correct : D. Regular

48. Consider the following CFG S → aB S → bA**spaceB → b A → a**spaceB → bS A → aS**spaceB → aBB A → bAA**space Consider the following derivation **spaceS ⇒aB**space⇒aaBB**space⇒aaBb**space⇒aabSb**space⇒aabbAb**space⇒aabbab**space This derivation is

Correct : D. Neither leftmost nor rightmost derivation

49. Consider the following language L = {anbncndn n ≥ 1} L is

Correct : B. CSL but not CFL

50. A language is represented by a regular expression (a)*(a + ba). Which of the following strings does not belong to the regular set represented by the above expression?

Correct : C. abab

51. Which of the following denotes Chomskianhiearchy?

Correct : A. REG ⊂ CFL ⊂ CSL ⊂ type0

52. The concept of FSA is much used in this part of the compiler

Correct : A. Lexical analysis

53. The following grammar G = (N, T, P, S)**spaceN = {S, A, B, C, D, E}**spaceT = {a, b, c}**spaceP : S → aAB**spaceAB → CD**spaceCD → CE**spaceC → aC**spaceC → b**spacebE → bc is

Correct : C. is type 1 but not type 2

54. The following CFG is in S → aBB**spaceB → bAA**spaceA → a**spaceB → b

Correct : D. Greibach normal form

55. Which of the following statements is wrong?

Correct : D. Context Sensitive Grammar(CSG) can be recognized by Finite State Machine

56. Context free grammar is not closed under

Correct : C. Complementation

57. Let the class of language accepted by finite state machine be L1 and the class of languages represented by regular expressions be L2 then

Correct : D. L1=L2

58. Which of the following statement is wrong?

Correct : D. All languages can be generated by context- free grammar

59. Grammar that produce more than one Parse tree for same sentence is:

Correct : A. Ambiguous

60. The language accepted by a Push down Automata:

Correct : C. Type 2

61. The PDA is called non-deterministic PDA when there are more than one out going edges from……… state:

Correct : C. READ or POP

62. Let L be a language defined over an alphabet ∑,then the language of strings , defined over ∑, not belonging to L denoted by LC or L. is called :

Correct : B. Complement of the language L

63. All NonNull words of the CFL can be generated by the corresponding CFG which is in CNF i.e the grammar in CNF will generate the same language except the:

Correct : C. Null string

64. 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?

Correct : B. 0*(10*10*)*

65. Consider the following Finite State Automaton The language accepted by this automaton is given by the regular expression

Correct : C. b*a(a+b)*

66. 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?

Correct : B. L1-L3 is recursively enumerable

67. Let L denotes the language generated by the grammar S – OSO/00. Which of the following is true?

Correct : B. L is regular but not O

68. Let S and T be language over ={a,b} represented by the regular expressions (a+b*)* and (a+b)*, respectively. Which of the following is true?

Correct : C. S=T

69. Which of the following pairs have DIFFERENT expressive power?

Correct : B. Deterministic push down automata (DPDA) and Non-deterministic pushdown automata

70. Match all items in Group 1 with correct options from those given in Group 2. List I List II**spaceP. Regular Expression 1. Syntax analysis**spaceQ. Push down automata 2. Code Generation**spaceR. Dataflow analysis 3. Lexical analysis**spaceS. Register allocation 4. Code optimization

Correct : B. P-3, Q-1, R-4, S-2

71. A minimum state deterministic finite automation accepting the language L = {W W € {0,1}* , number of 0's and 1's in W are divisible by 3 and 5 respectively has

Correct : A. 15 states

72. Any Language generated by an unrestricted grammar is:

Correct : A. Recursive

73. The Family of recursive language is not closed under which of the following operations:

Correct : D. None of the above.

74. PCP is:

Correct : B. Undecidable

75. If PCP is decidable then MPCP is

Correct : C. Can’t Say

76. Consider a language L for which there exists a Turing machine ™, T, that accepts every word in L and either rejects or loops for every word that is not in L. The language L is

Correct : D. Recursively enumerable

77. Consider the following statements I. Recursive languages are closed under complementation II. Recursively enumerable languages are closed under union III. Recursively enumerable languages are closed under complementation Which of the above statement are TRUE?

Correct : B. I and II

78. Recursively enumerable languages are not closed under

Correct : C. complementation

79. Which of the following problem is undecidable?

Correct : D. Membership problem for type 0 languages

80. Recursive languages are

Correct : A. A proper superset of CFL

81. Consider the following problem x. Given a Turing machine M over the input alphabet Σ, any state q of M. And a word w Є Σ*, does the computation of M on w visit the state q? Which of the following statements about x is correct?

Correct : A. X is decidable

82. 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 ?

Correct : D. xyxyx

83. Given A = {0,1} and L = A*. If R = (0n1n, n > 0), then language L ∪ R and R are respectively

Correct : D. Context free, not regular

84. 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?

Correct : B. L1 ∩ L2

85. The logic of pumping lemma is a good example of

Correct : A. Pigeon-hole principle

86. For two regular languages L1 = (a + b)* a and L2 = b (a + b ) *, the intersection of L1 and L2 is given by

Correct : D. b (a + b ) * a

87. Pumping lemma is generally used for proving that

Correct : B. Given grammar is not regular

88. What is the highest type number which can be applied to the following grammar? S —>Aa, A —> Ba, B —>abc

Correct : C. Type 2

89. Following syntax-directed translation scheme is used with a shift reduction (bottom up) parser that perform the action in braces immediately after a reduction by the corresponding production A —>aB {print “(1)” A —> c {print “1”), B —>Ab {print *2”}. When parser is aaacbbb, then string printed

Correct : A. 0202021

90. FSM can recognize

Correct : D. Only regular grammar

91. Basic limitation of FSM is that it

Correct : A. Cannot remember arbitrary large amount of information

92. Which of the following are decidable? 1) Whether the intersection of two regular language is infinite. 2) Whether a given context free language is regular. 3) Whether two push down automata accept the same language. 4) Whether a given grammar is context free.

Correct : B. 1 and 4

93. If L and L¯ are recursively enumerable, then L is

Correct : D. Recursive

94. Which of the following problems is undecidable?

Correct : B. Ambiguity problem for CFGs.

95. Fred created a new automaton model which is a push down automaton but with two stacks and the added ability of having commands which do not read input tape but which can pop from one stack and push into the other.This new automaton can recognize (choose strongest result)

Correct : D. Languages recognizable by Turing machine

96. Which of the following statements is/are FALSE? (1) For every non-deterministic Turing machine, there exists an equivalent deterministic Turing machine. (2) Turing recognizable languages are closed under union and complementation. (3) Turing decidable languages are closed under intersection and complementation (4) Turing recognizable languages are closed under union and intersection.

Correct : C. 2 only

97. Consider a string s over (0+1)*. The number of 0’s in s is denoted by no(s) and the number of 1’s in s is denoted by n1(s). The language that is not regular is

Correct : D. L = {s ε (0+1)* I no(s)-n1(s) I ≤ 4

98. Which one of the following is true regarding FOTRAN?

Correct : B. It is a context sensitive language

99. Which statement is true?

Correct : D. There is no reject state in the PDA.

100. TM is more powerful than FSM because

Correct : B. It has no finite state control