Context-Free Grammars & Languages

Answer & solution
Official answer: A
Approach: First identify what each helper nonterminal can generate, then substitute into each start production.
A→a is the base case. Each application of A→aA adds one a before eventually taking the base case, so A generates exactly an for n≥1. Similarly B generates exactly bn for n≥1. Neither can generate the empty string.
Taking S→aaB fixes the number of a’s at two and allows any positive number of b’s. Taking S→Abb allows any positive number of a’s and fixes the number of b’s at two. The language is the union of these alternatives, which is A.
For example aabbb is generated by the first branch, and ab b (the word abb) by the second. The grammar does not synchronize the two counts, so the equality and ratio conditions in B–D are unjustified. The common word aabb belongs to both branches but is counted just once in the language.