GATE 2017 CS (CS2) – Question 26
With start S and rules S→XY, X→aX|a, Y→aYb|ε, identify the language.
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (C) $\{a^mb^n:m>n,\ n\ge0\}$
Explanation
X produces aᵏ with k≥1. Y produces aⁿbⁿ with n≥0. Their concatenation is aᵏ⁺ⁿbⁿ, so the a exponent is strictly larger than n, while n can be zero. Conversely any m>n≥0 is obtained with k=m−n. Thus C.