GATE CS 2025 (Forenoon) — Question 19

Theory of Computation (TOC)Context-Free Grammars & Push-Down AutomataMCQ1 mark · −1/3 if wrongMedium

Consider the following context-free grammar \( G \), where \( S, A, \) and \( B \) are the variables (non-terminals), \( a \) and \( b \) are the terminal symbols, \( S \) is the start variable, and the rules of \( G \) are described as: \( S \rightarrow aaB \mid Abb \) \( A \rightarrow a \mid aA \) \( B \rightarrow b \mid bB \) Which ONE of the languages \( L(G) \) is accepted by \( G \)?
  1. A
    \( L(G) = \{a^2 b^n \mid n \ge 1\} \cup \{a^n b^2 \mid n \ge 1\} \)
  2. B
    \( L(G) = \{a^n b^{2n} \mid n \ge 1\} \cup \{a^{2n} b^n \mid n \ge 1\} \)
  3. C
    \( L(G) = \{a^n b^n \mid n \ge 1\} \)
  4. D
    \( L(G) = \{a^{2n} b^{2n} \mid n \ge 1\} \)
Practise the full 2025-FN paper
Challenge a friend: WhatsApp Telegram
From RENYXERAPractise this subject in the exam simulatorTimed, GATE-style tests with analytics that find your weak topics.
Practise more on Context-Free Grammars & Push-Down AutomataTimed, in the real exam interface · free to start

A GATE question every morning

One real past-paper question every morning for your branch, answer hidden until you tap. Free on Telegram.

Join
Stuck? Ask in the student group