Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

GATE | GATE-CS-2016 (Set 1) | Question 26

  • Last Updated : 01 Oct, 2021

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

S → aS|bS| ε
(A) {anbm | m,n >= 0}
(B) {w∈{a,b}* | w has equal number of a’s and b’s}
(C) {an | n>=0} U {anbn \ n>=0}
(D) {a,b}*

Answer: (D)

Explanation: We can draw DFA using given grammar S → aS|bS| ε and generates ε, a, ab, abb, b, aaa, …..

Attention reader! Don’t stop learning now.  Practice GATE exam well before the actual exam with the subject-wise and overall quizzes available in GATE Test Series Course.

Learn all GATE CS concepts with Free Live Classes on our youtube channel.


Therefore, language is {a, b}*.
Option (D) is true.

Quiz of this Question

My Personal Notes arrow_drop_up
Recommended Articles
Page :