Skip to content
Related Articles

Related Articles

ISRO | ISRO CS 2017 | Question 23
  • Last Updated : 16 Mar, 2018

Identify the language generated by the following grammar

S -> AB
 A -> aAb|ϵ
 B -> bB| b 

(A) {ambn | n>=m, m>0}
(B) {ambn | n>=m, m>=0}
(C) {ambn | n>m, m>0}
(D) {ambn | n>m, m>=0}


Answer: (D)

Explanation:

S -> AB
 A -> aAb|ϵ
 B -> bB| b 

strings generated by the the language:
b, bb, abb, abbb, aabbb and so on.

Alternative way –
The production rule B -> bB| b will generate bp, p ≥ 1
The production rule A -> aAb|ϵ will generate ambm, n ≥ 0
The production rule S -> AB will generate amb(m+p), i.e.,

{ambn | n>m, m>=0}

So option (D) is correct.


Quiz of this Question

My Personal Notes arrow_drop_up
Recommended Articles
Page :