All mock tests are FREE till 31 December — register to save your progress
UGC NET · PAPER 2

UGC NET Paper 2 Computer Science – Unit 8: Theory of Computation and Compilers PYQ (December 2022 Shift 1)

9 questions · answer key at the end · updated 11 Oct 2026
Q29. In the pumping lemma for context-free languages, for a string uvwxy, what is the minimum length of vx together?
  1. 0
  2. 1
  3. 2
  4. n
Answer & explanation →
Q30. Which of the following is an ε-free grammar?
  1. Type-0
  2. Type-1
  3. Type-2
  4. Type-3
Answer & explanation →
Q31. While processing a string, an LR parser reads the input
  1. From right to left
  2. From left to right
  3. Either from left to right or right to left
  4. From the centre of the string
Answer & explanation →
Q32. What are the minimum and maximum numbers of initial, dead, unreachable and final states in a valid n-state finite automaton whose accepted language is not φ?
  1. Minimum: 1, 1, 1, 1; Maximum: 1, (n−1), (n−1), n
  2. Minimum: 1, 0, 0, 0; Maximum: 1, (n−1), (n−1), n
  3. Minimum: 1, 0, 0, n; Maximum: 1, n, (n−1), (n−1)
  4. Minimum: 1, 0, 0, 1; Maximum: 1, (n−1), (n−1), n
Answer & explanation →
Q59. Which of the following finite automata recognise the language L = {a, b}*?
A. M = ({q0}, {a, b}, δ, q0, {q0}) with δ(q0, a) = {q0}, δ(q0, b) = {q0}
B. M = ({q0, q1}, {a, b}, δ, q0, {q0, q1}) with δ(q0, a) = δ(q0, b) = {q0, q1}, δ(q1, a) = δ(q1, b) = {q1}
C. M = ({q0, q1}, {a, b}, δ, q0, {q0, q1}) with δ(q0, a) = {q0, q1}, δ(q0, b) = {q0}, δ(q1, a) = –, δ(q1, b) = {q1}
D. M = ({q0, q1, q2}, {a, b}, δ, q0, {q0}) with δ(q0, a) = δ(q0, b) = {q0}, δ(q1, a) = {q2}, δ(q1, b) = –, δ(q2, a) = {q0}, δ(q2, b) = {q2}
  1. A and B
  2. A and D
  3. A, B and C
  4. A, B, C and D
Answer & explanation →
Q60. Which of the following statements are correct?
A. Syntax-directed translation can be applied in type checking.
B. Syntax-directed translation can be used in 3-address code generation.
C. Syntax-directed translation can be used in the construction of syntax trees.
D. Syntax-directed translation can be used to recognise valid tokens.
Choose the most appropriate answer from the options given below:
  1. A, B and C
  2. A, B, and D
  3. A, C and D
  4. B, C and D
Answer & explanation →
Q73. Match List I with List II (stack and input configurations)
List IList II
A. Initial configuration of stack and input in LL parsingI. $ | w$
B. Final configuration of stack and input in LL parsingII. $ | $
C. Initial configuration of stack and input in LR parsingIII. $S | w$
D. Final configuration of stack and input in LR parsingIV. $S | $
  1. A-III, B-IV, C-I, D-II
  2. A-III, B-II, C-I, D-IV
  3. A-II, B-III, C-IV, D-I
  4. A-II, B-IV, C-I, D-III
Answer & explanation →
Q83. The precedence of regular-expression operators from lowest to highest is:
  1. Star, Concatenation, Union
  2. Union, Star, Concatenation
  3. Union, Concatenation, Star
  4. Star, Union, Concatenation
Answer & explanation →
Q89. Consider the following statements:
A. For every regular language, we can design a Turing machine.
B. For every context-free language, we can design a Turing machine.
Which of the following is correct?
  1. Statement A is false and Statement B is true.
  2. Statement A and Statement B are both false.
  3. Statement A is true and Statement B is false.
  4. Statement A and Statement B are both true.
Answer & explanation →

Answer key

  1. 29 – B
  2. 30 – B
  3. 31 – B
  4. 32 – D
  5. 59 – D
  6. 60 – A
  7. 73 – B
  8. 83 – C
  9. 89 – D