Context-Free Grammars & Languages

Your answer
Answer & solution
Official answer: B
1. Applying G1’s outer production n times wraps n a’s before and n b’s after T. T supplies any cm, so L(G1)={an cm bn:n,m≥0}.
2. Similarly L(G2)={bn cm an:n,m≥0}. Any G1 word with n>0 starts with a, while any G2 word with positive outer count starts with b. Such words cannot agree.
3. Common words must have zero outer count in both grammars, leaving exactly c*. This contains ε,c,cc,..., so it is infinite and regular. Answer B.