GATE CS 2016, set 1 · Question 26 · Theory of Computation · Multiple choice (MCQ) · 1 mark · −1/3 for a wrong answer

Which of the following languages is generated by the given grammar?
S → aS | bS | ε

  1. (A) {aⁿ bᵐ | n, m ≥ 0}
  2. (B) {w ∈ {a,b}^* | w has equal number of a's and b's }
  3. (C) {aⁿ | n ≥ 0} ∪ {bⁿ | n ≥ 0} ∪ {aⁿ bⁿ | n ≥ 0}
  4. (D) {a,b}^*
Answer

Answer (D)

Answer from the official GATE CS 2016 answer key.

The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes