Gate2017 cs Q27

0. Consider the following context-free grammar over the alphabet ∑ = {a, b, c} with S as the start symbol:
S → abScT | abcT
T → bT | b
Which of the following represents the language generated by the above grammar?

  • Option : B
  • Explanation :
    The given Grammar over Σ = {a, b, c} with S as the start symbol is
    S → abScT | abcT
    T→ bT | b
    The minimum length string generated by the grammar is 1:
    S→abcT→abcb; hence all variable greater than 1.
    Other cases
    S → abScT→ ab abScT cT → ab ab abScT cT cT →........→ (ab)n (cT)n.
    Here T can generate any number of b’s starting with single b.
    Hence The language is
    {(abncbm1cbm2…cbmn | n, m1, m2, ….., mn ≥ 1 }
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *