GATE CS — Computer Science & IT Subject test

Theory of Computation — GATE Previous Year Questions

  • 12Questions
  • 20Total marks
  • 36Minutes

Every verified previous-year GATE question in the Theory of Computation section of the W3Colleges bank, in chronological order. Practise them untimed with worked explanations, or take the set as a timed test.

Start timed test Practice without timer

The timed run lasts 36 minutes and is held on the server.

Questions

Theory of Computation

Question 1

MCQ 2 marks · −0.66 Theory of Computation

Consider the languages \(L_1 = \{a^n b^n c^m \mid n, m > 0\}\) and \(L_2 = \{a^n b^m c^m \mid n, m > 0\}\). Which one of the following statements is FALSE?

Answers and explanations are free — they just need an account.

Question 2

MCQ 2 marks · −0.66 Theory of Computation

A minimum state deterministic finite automaton accepting the language \(L = \{w \mid w \in \{0,1\}^*\), number of 0s and 1s in \(w\) are divisible by 3 and 5, respectively\(\}\) has

Answers and explanations are free — they just need an account.

Question 3

MCQ 2 marks · −0.66 Theory of Computation

Let \(L = \{w \in (0+1)^* \mid w\) has an even number of 1s\(\}\), i.e. \(L\) is the set of all bit strings with an even number of 1s. Which one of the regular expressions below represents \(L\)?

Answers and explanations are free — they just need an account.

Question 4

MCQ 2 marks · −0.66 Theory of Computation

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 \(\bar{L}\) also context-free?
  3. If \(L\) is a regular language, then is \(\bar{L}\) also regular?
  4. If \(L\) is a recursive language, then is \(\bar{L}\) also recursive?

Answers and explanations are free — they just need an account.

Question 5

MCQ 1 marks · −0.33 Theory of Computation

Let \(L\) be a language and \(\bar{L}\) be its complement. Which one of the following is NOT a viable possibility?

Answers and explanations are free — they just need an account.

Question 6

MCQ 2 marks · −0.66 Theory of Computation

Let \(L_1 = \{w \in \{0,1\}^* \mid w\) has at least as many occurrences of (110)'s as (011)'s\(\}\). Let \(L_2 = \{w \in \{0,1\}^* \mid w\) has at least as many occurrences of (000)'s as (111)'s\(\}\). Which one of the following is TRUE?

Answers and explanations are free — they just need an account.

Question 7

MCQ 2 marks · −0.66 Theory of Computation

Let \(L\) be the language represented by the regular expression \(\Sigma^*0011\Sigma^*\), where \(\Sigma = \{0,1\}\). What is the minimum number of states in a DFA that recognizes \(\bar{L}\) (complement of \(L\))?

Answers and explanations are free — they just need an account.

Question 8

NAT 1 marks · no negative Theory of Computation

The number of states in the minimal deterministic finite automaton corresponding to the regular expression \((0+1)^*(10)\) is ______.

Answers and explanations are free — they just need an account.

Question 9

MCQ 1 marks · −0.33 Theory of Computation

Language \(L_1\) is defined by the grammar: \(S_1 \rightarrow a S_1 b \mid \varepsilon\)

Language \(L_2\) is defined by the grammar: \(S_2 \rightarrow ab S_2 \mid \varepsilon\)

Consider the following statements:

P: \(L_1\) is regular
Q: \(L_2\) is regular

Which one of the following is TRUE?

Answers and explanations are free — they just need an account.

Question 10

NAT 1 marks · no negative Theory of Computation

Consider the language \(L\) given by the regular expression \((a+b)^*b(a+b)\) over the alphabet \(\{a,b\}\). The smallest number of states needed in a deterministic finite-state automaton (DFA) accepting \(L\) is ______.

Answers and explanations are free — they just need an account.

Question 11

MCQ 2 marks · −0.66 Theory of Computation

For \(\Sigma = \{a,b\}\), let us consider the regular language \(L = \{x \mid x = a^{2+3k}\) or \(x = b^{10+12k},\ k \ge 0\}\). Which one of the following can be a pumping length (the constant guaranteed by the pumping lemma) for \(L\)?

Answers and explanations are free — they just need an account.

Question 12

MCQ 2 marks · −0.66 Theory of Computation

For a Turing machine \(M\), \(\langle M \rangle\) denotes an encoding of \(M\). Consider the following two languages.

\(L_1 = \{\langle M \rangle \mid M\) takes more than 2021 steps on all inputs\(\}\)
\(L_2 = \{\langle M \rangle \mid M\) takes more than 2021 steps on some input\(\}\)

Which one of the following options is correct?

Answers and explanations are free — they just need an account.