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 PYQ2021Theory of ComputationRegular Expressions and Finite AutomataMCQ · 1 mark
Let L⊆{0,1}∗L \subseteq \{0,1\}^* be an arbitrary regular language accepted by a minimal DFA\text{DFA} with kk states. Which one of the following languages must necessarily be accepted by a minimal DFA\text{DFA} with kk states?
Official PYQ2021Theory of ComputationRegular and Context-free LanguagesMSQ · 1 mark
Let L1L_1 be a regular language and L2L_2 be a context-free language. Which of the following languages is/are context-free?
Official PYQ2021Theory of ComputationRegular Expressions and Finite AutomataNAT · 1 mark
Consider the following deterministic finite automaton (DFA)\text{(DFA)} The number of strings of length 88 accepted by the above automaton is ___________
Official PYQ2021Theory of ComputationRegular Expressions and Finite AutomataMCQ · 2 marks
Suppose we want to design a synchronous circuit that processes a string of 00’s and 11’s. Given a string, it produces another string by replacing the first 11 in any subsequence of consecutive 11’s by a 00. Consider the following example. …
Official PYQ2021Theory of ComputationRegular and Context-free LanguagesMCQ · 2 marks
​​​​​​Consider the following two statements about regular languages: S1S_1: Every infinite regular language contains an undecidable language as a subset. S2S_2: Every finite language is regular. Which one of the following choices is correct?
Official PYQ2021Theory of ComputationContext-free Grammars and Push-down AutomataMSQ · 2 marks
For a string ww, we define wRw^R to be the reverse of ww. For example, if w=01101w=01101 then wR=10110w^R=10110. Which of the following languages is/are context-free?
Official PYQ2021Theory of ComputationRegular Expressions and Finite AutomataMSQ · 2 marks
Which of the following regular expressions represent(s) the set of all binary numbers that are divisible by three? Assume that the string ϵ\epsilon is divisible by three.
Official PYQ2020Theory of ComputationRegular Expressions and Finite AutomataMCQ · 1 mark
Which one of the following regular expressions represents the set of all binary strings with an odd number of 1’1’s?
Official PYQ2020Theory of ComputationRegular and Context-free LanguagesMCQ · 1 mark
Consider the following statements. If L1∪L2L_1 \cup L_2 is regular, then both L1L_1 and L2L_2 must be regular. The class of regular languages is closed under infinite union. Which of the above statements is/are TRUE?
Official PYQ2020Theory of ComputationRegular and Context-free LanguagesMCQ · 1 mark
Consider the language L={an∣n≥0}∪{anbn∣n≥0}L = \{a^{n}\mid n \geq 0\} \cup \{a^{n}b^{n}\mid n \geq 0\} and the following statements. LL is deterministic context-free. LL is context-free but not deterministic context-free. LL is not LL(k)LL(k) for any kk. Which of the above statements is/are TRUE?
Official PYQ2020Theory of ComputationRegular and Context-free LanguagesMCQ · 2 marks
Consider the following languages. L1={wxyx∣w,x,y∈(0+1)+}L2={xy∣x,y∈(a+b)∗,∣x∣=∣y∣,x≠y}\begin{array}{ll} L_1= \{ wxyx \mid w,x,y \in (0+1)^{+} \} \\ L_2= \{xy \mid x,y \in (a+b)^{*}, \mid x \mid=\mid y \mid, x \neq y \} \end{array} Which one of the following is TRUE?
Official PYQ2020Theory of ComputationRegular and Context-free LanguagesNAT · 2 marks
Consider the following language. L={x∈{a,b}∗∣L = \{{ x\in \{a,b\}^*\mid}number of aa’s in xx divisible by 22 but not divisible by 3}3\} The minimum number of states in DFA that accepts LL is _________
Official PYQ2019Theory of ComputationRegular and Context-free LanguagesMCQ · 1 mark
If LL is a regular language over Σ={a,b}\Sigma = \{a,b\}, which one of the following languages is NOT regular?
Official PYQ2019Theory of ComputationPumping LemmaMCQ · 1 mark
For Σ={a,b}\Sigma = \{a ,b \}, let us consider the regular language L={x∣x=a2+3k or x=b10+12k,k≥0}L=\{x \mid x = a^{2+3k} \text{ or } x=b^{10+12k}, k \geq 0\}. Which one of the following can be a pumping length (the constant guaranteed by the pumping lemma) for LL ?
Official PYQ2019Theory of ComputationContext-free Grammars and Push-down AutomataMCQ · 2 marks
Which one of the following languages over Σ={a,b}\Sigma=\{a, b\} is NOT context-free?
Official PYQ2019Theory of ComputationRegular and Context-free LanguagesMCQ · 2 marks
Consider the following sets: S1: Set of all recursively enumerable languages over the alphabet {0,1}\{0, 1\} S2: Set of all syntactically valid C programs S3: Set of all languages over the alphabet {0,1}\{0,1\} S4: Set of all non-regular languages over the alphabet {0,1}\{ 0,1 \} Which of the above sets are uncountable?
Official PYQ2019Theory of ComputationRegular Expressions and Finite AutomataNAT · 2 marks
Let Σ\Sigma be the set of all bijections from {1,…,5}\{1, \dots , 5\} to {1,…,5}\{1, \dots , 5 \}, where idid denotes the identity function, i.e. id(j)=j,∀jid(j)=j, \forall j. Let ∘\circ denote composition on functions. For a string x=x1x2…xn∈Σn,n≥0x=x_1 x_2 \dots x_n \in \Sigma^n, n \geq 0, let π(x)=x1∘x2∘⋯∘xn\pi(x)=x_1 \circ x_2 \circ \dots \circ x_n. Consider the language …
Official PYQ2018Theory of ComputationRegular and Context-free LanguagesNAT · 2 marks
Given a language LL, define LiL^i as follows:L0={ε}L^0 = \{ \varepsilon \}Li=Li−1∙L for all I>0L^i = L^{i-1} \bullet L \text{ for all } I >0The order of a language LL is defined as the smallest kk such that Lk=Lk+1L^k = L^{k+1}. Consider the language L1(L_1 (over alphabet 0)0) accepted by the following automaton. The order of L1L_1 is ________.
Official PYQ2018Theory of ComputationUndecidabilityMCQ · 2 marks
Consider the following problems. L(G)L(G) denotes the language generated by a grammar GG. L(M) denotes the language accepted by a machine MM. For an unrestricted grammar GG and a string ww, whether w∈L(G)w \in L(G) Given a Turing machine MM, whether L(M)L(M) is regular Given two grammarG1G_1 and G2G_2, whether L(G1)=L(G2)L(G_1) = L(G_2) Given an …
Official PYQ2018Theory of ComputationContext-free Grammars and Push-down AutomataMCQ · 2 marks
Consider the following languages: {ambncpdq∣m+p=n+q, where m,n,p,q≥0}\{a^mb^nc^pd^q \mid m+p=n+q, \text{ where } m, n, p, q \geq 0 \} {ambncpdq∣m=n and p=q, where m,n,p,q≥0}\{a^mb^nc^pd^q \mid m=n \text{ and }p=q, \text{ where } m, n, p, q \geq 0 \} {ambncpdq∣m=n=p and p≠q, where m,n,p,q≥0}\{a^mb^nc^pd^q \mid m=n =p \text{ and } p \neq q, \text{ where } m, n, p, q \geq 0 \} {ambncpdq∣mn=p+q, where m,n,p,q≥0}\{a^mb^nc^pd^q \mid mn =p+q, \text{ where } m, n, p, q \geq 0 \} Which of the …