All mock tests are FREE till 31 December — register to save your progress
Paper 2 CS · UNIT 08

Theory of Computation and Compilers – Previous Year Questions

250 questions from past UGC NET Paper 2 – Computer Science papers, each with the correct answer. Open any question for its explanation.

  1. Two finite state machines are said to be equivalent if they :
    Answer: C. Recognize the same set of tokens Paper 2 CS · July 2018
  2. The finite state machine given in figure below recognizes :
    Answer: D. any string of odd number of a’s and odd number of b’s Paper 2 CS · July 2018
  3. A pushdown automata behaves like a Turing machine when the number of auxiliary memory is :
    Answer: D. 2 or more Paper 2 CS · July 2018
  4. Pushdown automata can recognize language generated by_________.
    Answer: C. Context free grammar or regular grammar Paper 2 CS · July 2018
  5. To obtain a string of n Terminals from a given Chomsky normal form grammar, the number of productions to be used is :
    Answer: A. 2n − 1 Paper 2 CS · July 2018
  6. Consider the two grammars: G₁: S → SbS | a G₂: S → aB | ab, A → AAB | a, B → ABb | b Which of the following options is correct?
    Answer: C. Both G₁ and G₂ are ambiguous Paper 2 CS · July 2018
  7. Context-sensitive language can be recognized by a :
    Answer: D. Linear bounded automata Paper 2 CS · July 2018
  8. The set A= { 0n1n2n | n= 1, 2, 3,..............} is an example of a grammar that is :
    Answer: A. Context-sensitive Paper 2 CS · July 2018
  9. A bottom-up parser generates :
    Answer: B. Right-most derivation in reverse Paper 2 CS · July 2018
  10. Consider the statements: S₁: There exists no algorithm for deciding whether any two Turing machines M₁ and M₂ accept the same language. S₂: The problem of determining whether a Turing machine halts on any input is undec…
    Answer: A. Both S₁ and S₂ are correct Paper 2 CS · July 2018