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 PYQ2018Theory of ComputationRegular Expressions and Finite AutomataMCQ · 1 mark
Let NN be an NFA with nn states. Let kk be the number of states of a minimal DFA which is equivalent to NN. Which one of the following is necessarily true?
Official PYQ2018Theory of ComputationRegular and Context-free LanguagesMCQ · 1 mark
The set of all recursively enumerable languages is:
Official PYQ2017Theory of ComputationUndecidabilityMCQ · 1 mark
Let AA and BB be finite alphabets and let #\# be a symbol outside both AA and BB. Let ff be a total function from A∗A^{*} to B∗B^{*}. We say ff is computable if there exists a Turing machine MM which given an input x∈A∗x \in A^{*}, always halts with f(x)f(x) on its tape. Let LfL_{f} denote the language …
Official PYQ2017Theory of ComputationContext-free Grammars and Push-down AutomataMCQ · 1 mark
Consider the following languages over the alphabet Σ={a,b,c}\Sigma = \left \{ a, b, c \right \}. Let L1={anbncm∣m,n≥0}L_{1} = \left \{ a^{n}b^{n}c^{m}\mid m,n \geq 0 \right \} and L2={ambncn∣m,n≥0}L_{2} = \left \{ a^{m}b^{n}c^{n}\mid m,n \geq 0 \right \}. Which of the following are context-free languages? L1∪L2L_{1} \cup L_{2} L1∩L2L_{1} \cap L_{2}
Official PYQ2017Theory of ComputationContext-free Grammars and Push-down AutomataMCQ · 1 mark
Consider the context-free grammars over the alphabet {a,b,c}\left \{ a, b, c \right \} given below. SS and TT are non-terminals. G1:S→aSb∣T,T→cT∣ϵG_{1}:S\rightarrow aSb \mid T, T \rightarrow cT \mid \epsilon G2:S→bSa∣T,T→cT∣ϵG_{2}:S\rightarrow bSa \mid T, T \rightarrow cT \mid \epsilon The language L(G1)∩L(G2)L\left ( G_{1} \right )\cap L(G_{2}) is
Official PYQ2017Theory of ComputationContext-free Grammars and Push-down AutomataMCQ · 1 mark
If GG is a grammar with productions S→SaS∣aSb∣bSa∣SS∣ϵS\rightarrow SaS\mid aSb\mid bSa\mid SS\mid\epsilon where SS is the start variable, then which one of the following strings is not generated by GG?
Official PYQ2017Theory of ComputationRegular Expressions and Finite AutomataNAT · 1 mark
Consider the language LL given by the regular expression (a+b)∗b(a+b)(a+b)^{*} b (a+b) over the alphabet {a,b}\{a,b\}. The smallest number of states needed in a deterministic finite-state automaton (DFA) accepting LL is ___________ .
Official PYQ2017Theory of ComputationContext-free Grammars and Push-down AutomataMCQ · 1 mark
Consider the following context-free grammar over the alphabet Σ={a,b,c}\Sigma = \{a,b,c\} with SS as the start symbol:S→abScT∣abcTS \rightarrow abScT \mid abcTT→bT∣bT \rightarrow bT \mid bWhich one of the following represents the language generated by the above grammar?
Official PYQ2017Theory of ComputationUndecidabilityMCQ · 1 mark
Let L(R)L(R) be the language represented by regular expression RR. Let L(G)L(G) be the language generated by a context free grammar GG. Let L(M)L(M) be the language accepted by a Turing machine MM. Which of the following decision problems are undecidable? Given a regular expression RR and a string ww, is w∈L(R)w \in L(R)? Given a context-free …
Official PYQ2017Theory of ComputationRegular and Context-free LanguagesMCQ · 1 mark
Consider the following languages. L1={ap∣p is a prime number}L_1 = \{a^p \mid p \text{ is a prime number} \} L2={anbmc2m∣n≥0,m≥0}L_2 = \{ a^nb^mc^{2m} \mid n \geq 0, m \geq 0 \} L3={anbnc2n∣n≥0}L_3 = \{a^n b^n c^{2n} \mid n \geq 0 \} L4={anbn∣n≥1}L_4 = \{ a^n b^n \mid n \geq 1\} Which of the following are CORRECT? L1L_1 is context free but not regular L2L_2 is not context free L3L_3 is not context free but …
Official PYQ2017Theory of ComputationContext-free Grammars and Push-down AutomataMCQ · 1 mark
Identify the language generated by the following grammar, where SS is the start variable. S→XYS \rightarrow XY X→aX∣aX \rightarrow aX \mid a Y→aYb∣ϵY \rightarrow aYb \mid \epsilon
Official PYQ2017Theory of ComputationRegular Expressions and Finite AutomataNAT · 1 mark
The minimum possible number of states of a deterministic finite automaton that accepts the regular language LL = {w1aw2w_{1}aw_{2} | w1,w2w_{1},w_{2} ∈\in {a,b}∗\left \{ a,b \right \}^{*} , ∣w1∣=2,∣w2∣≥3\left | w_{1} \right | = 2, \left | w_{2} \right |\geq 3} is ______________ .
Official PYQ2017Theory of ComputationRegular and Context-free LanguagesMCQ · 1 mark
Let L1,L2L_1, L_2 be any two context-free languages and RR be any regular language. Then which of the following is/are CORRECT? L1∪L2L_1 \cup L_2 is context-free L1‾\overline{L_1} is context-free L1−RL_1 - R is context-free L1∩L2L_1 \cap L_2 is context-free
Official PYQ2016Theory of ComputationContext-free Grammars and Push-down AutomataMCQ · 1 mark
Consider the transition diagram of a PDA given below with input alphabet Σ={a,b}\Sigma=\{a,b\} and stack alphabet Γ={X,Z}\Gamma = \{X,Z\}. ZZ is the initial stack symbol. Let LL denote the language accepted by the PDA Which one of the following is TRUE?
Official PYQ2016Theory of ComputationUndecidabilityMCQ · 1 mark
Let XX be a recursive language and YY be a recursively enumerable but not recursive language. Let WW and ZZ be two languages such that Y‾\overline{Y} reduces to WW, and ZZ reduces to X‾\overline{X} (reduction means the standard many-one reduction). Which one of the following statements is TRUE?
Official PYQ2016Theory of ComputationContext-free Grammars and Push-down AutomataMCQ · 1 mark
Consider the following context-free grammars; G1:S→aS∣B,B→b∣bBG_1 : S \to aS \mid B, B \to b \mid bB G2:S→aA∣bB,A→aA∣B∣ε,B→bB∣εG_2 : S \to aA \mid bB, A \to aA \mid B \mid \varepsilon,B \to bB \mid \varepsilon Which one of the following pairs of languages is generated by G1G_1 and G2G_2 ,respectively?
Official PYQ2016Theory of ComputationUndecidabilityMCQ · 1 mark
Which of the following decision problems are undecidable? Given NFAs N1N_1 and N2N_2 , is L(N1)∩L(N2)=ΦL(N_1) \cap L(N_2) = \Phi Given a CFG G=(N,Σ,P,S)G = (N,\Sigma,P,S) and a string x∈Σ∗x \in \Sigma^{*}, does x∈L(G)x \in L(G)} ? Given CFGs G1G_1 and G2G_2, is L(G1)=L(G2)L (G_1) = L(G_2)? Given a TM MM, is L(M)=ΦL(M)=\Phi ?
Official PYQ2016Theory of ComputationRegular Expressions and Finite AutomataMCQ · 1 mark
Which one of the following regular expressions represents the language: the set of all binary strings having two consecutive 00's and two consecutive 11's?
Official PYQ2016Theory of ComputationContext-free Grammars and Push-down AutomataMCQ · 1 mark
Which of the following languages is generated by the given grammar? S→aS∣bS∣εS \rightarrow aS \mid bS \mid \varepsilon
Official PYQ2016Theory of ComputationContext-free Grammars and Push-down AutomataMCQ · 1 mark
Consider the following languages: L1={anbmcn+m:m,n≥1}L_{1}=\left\{a^{n}b^{m}c^{n+m}:m, n\geq 1\right\} L2={anbnc2n:n≥1}L_{2}=\left\{a^{n}b^{n}c^{2n} :n\geq 1\right\} Which one of the following is TRUE?