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

GATE · 2016 · CS · Set 1 · Computer Science & IT

Which of the following languages is generated by the given grammar?

S → aS | bS | ε

  1. A.

    {an bm | n,m ≥ 0}

  2. B.

    {w ∈ {a,b}∗ | w has equal number of a’s and b’s }

  3. C.

    {an | n ≥ 0} ∪ {bn | n ≥ 0} ∪ {an bn | n ≥ 0}

  4. D.

    {a,b}* 

Attempted by 247 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…