GATE CS 2024, set 2 · Question 52 · Theory of Computation · Multiple select (MSQ) · 2 marks · no negative marks
Consider a context-free grammar G with the following 3 rules.
S → aS, S → aSbS, S → c
Let w ∈ L(G). Let nₐ(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?
- (A) nₐ(w) > n_b(w)
- (B) nₐ(w) > n_c(w) - 2
- (C) n_c(w) = n_b(w) + 1
- (D) n_c(w) = n_b(w) ∗ 2
Answer
Answer (B), (C)
Answer from the official GATE CS 2024 answer key.
The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes