Skip to content

GATE CS Theory of Computation questions

Practise Theory of Computation questions for GATE CS. Explore official PYQs and original subject-wise quizzes, check answers and view available solutions. Free, no sign-in.

Subject, topic, year and type filter the full library. Match any choice within a filter, and all selected filter categories. Search, source and sort apply to this page.

20 on this page
Official PYQ2016Theory of ComputationTuring MachinesMCQ · 1 mark
Consider the following languages. L1={⟨M⟩∣M takes at least 2016 steps on some input}L_{1} = \left\{\left\langle M \right\rangle \mid M \text{ takes at least 2016 steps on some input} \right\}, L2={⟨M⟩∣M takes at least 2016 steps on all inputs}L_{2} = \left\{\left\langle M \right\rangle \mid M \text{ takes at least 2016 steps on all inputs} \right\} and L3={⟨M⟩∣M accepts ϵ}L_{3} = \left\{\left\langle M \right\rangle \mid M \ \text{accepts }\epsilon\right\}, where …
Official PYQ2016Theory of ComputationRegular Expressions and Finite AutomataMCQ · 1 mark
Consider the following two statements: If all states of an NFA are accepting states then the language accepted by the NFA is Σ∗\Sigma_{}^{*}. There exists a regular language AA such that for all languages BB, A∩BA \cap B is regular. Which one of the following is CORRECT?
Official PYQ2016Theory of ComputationRegular and Context-free LanguagesMCQ · 1 mark
Consider the following types of languages: L1L_{1}: Regular, L2L_{2}: Context-free, L3L_{3}: Recursive, L4L_{4}: Recursively enumerable. Which of the following is/are TRUE ? L3‾∪L4\overline{L_{3}} \cup L_{4} is recursively enumerable. L2‾∪L3\overline{L_{2}} \cup L_{3} is recursive. L1∗∩L2L^{*} _{1} \cap L_{2} is context-free. …
Official PYQ2016Theory of ComputationRegular Expressions and Finite AutomataNAT · 1 mark
The number of states in the minimum sized DFA that accepts the language defined by the regular expression. (0+1)∗(0+1)(0+1)∗(0+1)^{*} (0+1) (0+1)^{*} is ________.
Official PYQ2016Theory of ComputationRegular and Context-free LanguagesMCQ · 1 mark
Language L1L_{1} is defined by the grammar: S1→aS1b∣εS_{1} \rightarrow a S_{1} b \mid \varepsilon Language L2L_{2} is defined by the grammar: S2→abS2∣εS_{2} \rightarrow a b S_{2} \mid \varepsilon Consider the following statements: P: L1L_{1} is regular Q: L2L_{2} is regular Which one of the following is TRUE?
Official PYQ2015Theory of ComputationRegular Expressions and Finite AutomataNAT · 1 mark
Consider the DFAs MM and NN given above. The number of states in a minimal DFA that accept the language L(M)∩L(N)L(M) \cap L(N) is_____________.
Official PYQ2015Theory of ComputationContext-free Grammars and Push-down AutomataMCQ · 1 mark
Consider the NPDA ⟨Q={q0,q1,q2},Σ={0,1},Γ={0,1,⊥},δ,q0,⊥,F={q2}⟩\left \langle Q= \left \{ q_{0}, q_{1}, q_{2} \right \},\Sigma = \left \{ 0, 1 \right \}, \Gamma = \left \{ 0, 1, \perp \right \}, \delta, q_{0}, \perp, F =\left \{ q_{2} \right \} \right \rangle, where (as per usual convention) QQ is the set of states, Σ\Sigma is the input alphabet, Γ\Gamma is the stack alphabet, δ\delta is …
Official PYQ2015Theory of ComputationTuring MachinesMCQ · 1 mark
For any two languages L1L_{1} and L2L_{2} such that L1L_{1} is context-free and L2L_{2} is recursively enumerable but not recursive, which of the following is/are necessarily true? Lˉ1\bar{L}_{1} ( Complement of L1L_{1}) is recursive Lˉ2\bar{L}_{2} ( Complement of L2L_{2}) is recursive Lˉ1\bar{L}_{1} is context-free Lˉ1\bar{L}_{1} ∪ L2L_{2} …
Official PYQ2015Theory of ComputationRegular Expressions and Finite AutomataNAT · 1 mark
The number of states in the minimal deterministic finite automaton corresponding to the regular expression (0+1)∗(10)(0+1)^* (10) is _____.
Official PYQ2015Theory of ComputationRegular and Context-free LanguagesMCQ · 1 mark
Which of the following is/are regular languages? L1:{wxwR∣w,x∈{a,b}∗ and ∣w∣,∣x∣>0},wR is the reverse of string wL_1: \left\{ wxw^R \mid w, x \in \{a, b\} ^* \text{ and } |w|, |x| > 0\right\}, w^R \text{ is the reverse of string } w L2:{anbm∣m≠n and m,n≥0}L_2: \left\{ a^nb^m \mid m \neq n \text{ and } m, n \geq 0 \right\} L3:{apbqcr∣p,q,r≥0}L_3: \left\{ a^pb^qc^r \mid p, q, r \geq 0 \right\}
Official PYQ2015Theory of ComputationRegular Expressions and Finite AutomataMCQ · 1 mark
Consider the alphabet Σ={0,1}\Sigma = \{0, 1\}, the null/empty string λ\lambda and the set of strings X0,X1, and X2X_0, X_1, \text{ and } X_2 generated by the corresponding non-terminals of a regular grammar. X0,X1, and X2X_0, X_1, \text{ and } X_2 are related as follows. X0=1X1X_0 = 1 X_1 X1=0X1+1X2X_1 = 0 X_1 + 1 X_2 X2=0X1+{λ}X_2 = 0 X_1 + \{ \lambda \} Which one of the following …
Official PYQ2015Theory of ComputationUndecidabilityMCQ · 1 mark
Consider the following statements. The complement of every Turing decidable language is Turing decidable There exists some language which is in NP but is not Turing decidable If L is a language in NP, L is Turing decidable Which of the above statements is/are true?
Official PYQ2015Theory of ComputationRegular and Context-free LanguagesMCQ · 1 mark
Consider two decision problems Q1,Q2Q_1, Q_2 such that Q1Q_1 reduces in polynomial time to 3-SAT and 3-SAT reduces in polynomial time to Q2Q_2. Then which one of the following is consistent with the above statement?
Official PYQ2015Theory of ComputationUndecidabilityMCQ · 1 mark
Language L1L_1 is polynomial time reducible to language L2L_2. Language L3L_3 is polynomial time reducible to language L2L_2, which in turn polynomial time reducible to language L4L_4. Which of the following is/are true?  if L4∈P, then L2∈P\text{ if } L_4 \in P, \text{ then } L_2 \in P  if L1∈P or L3∈P, then L2∈P\text{ if } L_1 \in P\text{ or } L_3 \in P, \text{ then } L_2 \in P …
Official PYQ2015Theory of ComputationContext-free Grammars and Push-down AutomataMCQ · 1 mark
Which of the following languages are context-free? L1:{ambnanbm∣m,n≥1}L_1: \left\{a^mb^na^nb^m \mid m, n \geq 1\right\} L2:{ambnambn∣m,n≥1}L_2: \left\{a^mb^na^mb^n \mid m, n \geq 1\right\} L3:{ambn∣m=2n+1}L_3: \left\{a^mb^n \mid m = 2n +1 \right\}
Official PYQ2015Theory of ComputationRegular Expressions and Finite AutomataMCQ · 1 mark
Let LL be the language represented by the regular expression Σ∗0011Σ∗\Sigma^*0011\Sigma^* where Σ={0,1}\Sigma = \{0, 1\}. What is the minimum number of states in a DFA that recognizes Lˉ\bar{L} (complement of LL)?
Official PYQ2014Theory of ComputationTuring MachinesMCQ · 1 mark
Suppose a polynomial time algorithm is discovered that correctly computes the largest clique in a given graph. In this scenario, which one of the following represents the correct Venn diagram of the complexity classes P, NP and NP Complete (NPC)?
Official PYQ2014Theory of ComputationRegular Expressions and Finite AutomataMCQ · 1 mark
Which of the regular expressions given below represent the following DFA? 0∗1(1+00∗1)∗0^*1(1+00^*1)^* 0∗1∗1+11∗0∗10^*1^*1+11^*0^*1 (0+1)∗1(0+1)^*1
Official PYQ2014Theory of ComputationUndecidabilityMCQ · 1 mark
Let LL be a language and Lˉ\bar{L} be its complement. Which one of the following is NOT a viable possibility?
Official PYQ2014Theory of ComputationRegular Expressions and Finite AutomataMCQ · 1 mark
Consider the finite automaton in the following figure: What is the set of reachable states for the input string 00110011?