Regular Grammar: GATE CS Previous Year Questions

Regular Grammar · Theory of Computation

6 questions · asked in 5 of 27 years (2000–2026)

MCQ 61-mark 5 · 2-mark 1

2000Questions per year2026

Questions 1–5 of 6

Q1GATE 2015 (Session 2)2 marksMCQ−0.67 if wrong
Consider the alphabet Σ\Sigma={0, 1}, the null/empty string λ\lambda and the sets of strings X0,X1,  and  X2X_{0}, X_{1}, \; and \; X_{2} generated by the corresponding non-terminals of a regular grammar. X0,X1,  and  X2X_{0}, X_{1}, \; and \; X_{2} are related as follows.
X0=1X1X_{0}=1X_{1}
X1=0X1+1X2X_{1}=0X_{1}+1 X_{2}
X2=0X1+{λ}X_{2}=0X_{1}+ \{\lambda\}
Which one of the following choices precisely represents the strings in X0X_{0}?

Q2GATE 20071 markMCQ−0.33 if wrong
Consider the following two statements:

P: Every regular grammar is LL(1)
Q: Every regular set has a LR(1) grammar

Which of the following is TRUE?

Q3GATE 20061 markMCQ−0.33 if wrong
Consider the regular grammar below
S→bS∣aA∣ϵS \rightarrow bS \mid aA \mid \epsilon
A→aS∣bAA \rightarrow aS \mid bA
The Myhill-Nerode equivalence classes for the language generated by the grammar are

Q4GATE 20051 markMCQ−0.33 if wrong
Consider the regular grammar:
S→Xa∣YaS \rightarrow Xa \mid Ya
X→ZaX \rightarrow Za
Z→Sa∣ϵZ \rightarrow Sa \mid \epsilon
Y→WaY \rightarrow Wa
W→SaW \rightarrow Sa
where S is the starting symbol, the set of terminals is {a} and the set of non-terminals is {S, W, X, Y, Z}.
We wish to construct a deterministic finite automaton (DFA) to recognize the same language. What is the minimum number of states required for the DFA?

Q5GATE 20041 markMCQ−0.33 if wrong
Consider the following grammar G:
S → bS | aA | b
A → bA | aB
B → bB | aS | a

Let Na(w) and Nb(w) denote the number of a's and b's in a string w respectively.
The language L(G)⊆{a,b}+L(G)\subseteq \{a,b\}^{+} generated by G is

Keep practising

Topics in Theory of Computation

All CS topics ›