Context Free Grammar: GATE CS Previous Year Questions

Context Free Grammar · Theory of Computation

33 questions · asked in 12 of 27 years (2000–2026)

MCQ 26 · MSQ 5 · NAT 21-mark 15 · 2-mark 18

2000Questions per year2026

Questions 16–20 of 33

Q16GATE 2017 (Session 2)1 markMCQ−0.33 if wrong
Identify the language generated by the following grammar, where S is start variable.
S→\rightarrow XY
X→\rightarrow aX|a
Y →\rightarrowaYb|∈\in

Q17GATE 2017 (Session 2)2 marksMCQ−0.67 if wrong
Consider the following expression grammar G:
E→\rightarrowE-T|T
T→\rightarrowT+F|F
F→\rightarrow(E)|id
Which of the following grammars is not left recursive, but is equivalent to G?

Q18GATE 2016 (Session 1)1 markMCQ−0.33 if wrong
Which of the following languages is generated by the given grammar?
S→aS∣bS∣εS\rightarrow aS|bS|\varepsilon

Q19GATE 2016 (Session 1)2 marksMCQ−0.67 if wrong
Consider the following context-free grammars:

G1: S→\rightarrowaS|B,
B→\rightarrowb|bB
G2: S→\rightarrowaA|bB,
A→\rightarrowaA|B|ε\varepsilon,
B→\rightarrowbB|ε\varepsilon

Which one of the following pair of languages is generated by G1 and G2, respectively?

Q20GATE 2016 (Session 2)2 marksMCQ−0.67 if wrong
Which one of the following grammars is free from left recursion?

Keep practising

Topics in Theory of Computation

All CS topics ›