Skip to content

GATE CS Regular and Context-free Languages questions

Practise Regular and Context-free Languages questions for GATE CS. Explore official PYQs and original topic-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 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 ComputationRegular and Context-free LanguagesMCQ · 1 mark
The set of all recursively enumerable languages is:
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 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 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 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 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 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 PYQ2014Theory of ComputationRegular and Context-free LanguagesMCQ · 1 mark
Which one of the following is TRUE?
Official PYQ2014Theory of ComputationRegular and Context-free LanguagesMCQ · 1 mark
Let L1={w∈{0,1}∗∣wL_1=\{w\in\{0,1\}^*\mid w  has at least as many occurrences of \text{ has at least as many occurrences of } (110)′s as (110)'\text{s as } (011)′s}(011)'\text{s} \}. Let L2={w∈{0,1}∗ ∣wL_2=\{w \in\{0,1\}^*\ \mid w  has at least as many occurrences of \text{ has at least as many occurrences of } (000)′s as(000)'\text{s as} (111)′s}(111)'\text{s} \}. Which one of the following is TRUE?
Official PYQ2014Theory of ComputationRegular and Context-free LanguagesMCQ · 1 mark
If L1 ={an∣n ≥ 0}L_1\:=\{a^n \mid n\:\geq\:0\} and L2 ={bn∣n ≥ 0}L_2\:= \{b^n \mid n\:\geq\:0\} , consider L1.L2L_1.L_2 is a regular language L1.L2={anbn∣n ≥ 0}L_1.L_2 = \{a^nb^n \mid n\: \geq \:0\} Which one of the following is CORRECT?
Official PYQ2014Theory of ComputationRegular and Context-free LanguagesMCQ · 1 mark
Let Σ\Sigma be a finite non-empty alphabet and let 2Σ∗2^{\Sigma^*} be the power set of Σ∗\Sigma^*. Which one of the following is TRUE?
Official PYQ2013Theory of ComputationRegular and Context-free LanguagesMCQ · 1 mark
Consider the following languages. L1={0p1q0r∣p,q,r≥0}L_1 = \left \{ 0^p1^q0^r \mid p,q,r \geq 0 \right \} L2={0p1q0r∣p,q,r≥0,p≠r}L_2 = \left \{ 0^p1^q0^r \mid p,q,r \geq 0, p\neq r \right \} Which one of the following statements is FALSE?
Official PYQ2013Theory of ComputationRegular and Context-free LanguagesMCQ · 1 mark
Which of the following statements is/are FALSE? For every non-deterministic Turing machine, there exists an equivalent deterministic Turing machine. Turing recognizable languages are closed under union and complementation. Turing decidable languages are closed under intersection and complementation. Turing recognizable languages are closed under union and …
Official PYQ2013Theory of ComputationRegular and Context-free LanguagesMCQ · 1 mark
Consider the languages L1=ϕL_1 = \phi and L2={a}L_2 = \{a\}. Which one of the following represents L1L2∗∪L1∗L_1 {L_2}^* \cup {L_1}^* ?
Official PYQ2012Theory of ComputationRegular and Context-free LanguagesMCQ · 1 mark
Given the language L={ab,aa,baa}L = \left\{ab, aa, baa\right\}, which of the following strings are in L∗L^{*}? abaabaaabaaabaabaaabaa aaaabaaaaaaaabaaaa baaaaabaaaabbaaaaabaaaab baaaaabaabaaaaabaa
Official PYQ2012Theory of ComputationRegular and Context-free LanguagesMCQ · 1 mark
Assuming P≠NP\textsf{P} \neq \textsf{NP}, which of the following is TRUE?
Official PYQ2011Theory of ComputationRegular and Context-free LanguagesMCQ · 1 mark
Let PP be a regular language and QQ be a context-free language such that Q⊆PQ \subseteq P. (For example, let PP be the language represented by the regular expression p∗q∗p^*q^* and QQ be {pnqn∣n∈N})\{p^nq^n \mid n \in N\}). Then which of the following is ALWAYS regular?
Official PYQ2011Theory of ComputationRegular and Context-free LanguagesMCQ · 1 mark
Consider the languages L1, L2 and L3L1, \:L2 \:and \: L3 as given below. L1={0p1q∣p,q∈N},L2={0p1q∣p,q∈N and p=q} and,L3={0p1q0r∣p,q,r∈N and p=q=r}.L1=\{0^p 1^q \mid p, q \in N\}, \\ L2 = \{0^p 1^q \mid p, q \in N \:and \:p=q\} \: and, \\ L3 = \{0^p 1^q 0^r \mid p, q, r \in N\: and \: p=q=r\}. Which of the following statements is NOT TRUE?
Official PYQ2009Theory of ComputationRegular and Context-free LanguagesMCQ · 1 mark
Let L=L1∩L2L = L_1 \cap L_2, where L1L_1 and L2L_2 are languages as defined below: L1={ambmcanbn∣m,n≥0}L_1= \left \{ a^m b^mca^nb^n \mid m,n \geq 0 \right \} L2={aibjck∣i,j,k≥0}L_2=\left \{ a^i b^j c^k \mid i,j,k \geq 0 \right \} Then LL is