GATE CS 2024 (Afternoon) — Question 52

Theory of Computation (TOC)Context-Free Grammars & Push-Down AutomataMSQ2 marksMedium

Consider a context-free grammar \( G \) with the following 3 rules. \( S \rightarrow aS \) \( S \rightarrow aSbS \) \( S \rightarrow c \) Let \( w \in L(G) \). Let \( n_a(w), n_b(w), n_c(w) \) denote the number of times \( a, b, c \) occur in \( w \), respectively. Which of the following statements is/are TRUE?
  1. A
    \( n_a(w) > n_b(w) \)
  2. B
    \( n_a(w) > n_c(w) - 2 \)
  3. C
    \( n_c(w) = n_b(w) + 1 \)
  4. D
    \( n_c(w) = n_b(w) * 2 \)
Practise the full 2024-AN paper
Challenge a friend: WhatsApp Telegram
Recommended book · affiliate linkIntroduction to Automata Theory (Hopcroft & Ullman)Regular languages, CFGs, pushdown automata and Turing machines.
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