Similar questions 2 more →
Context-Free Grammars & Languages

Answer & solution
Official answer: B
L1 is generated by S→aSc|aBc and B→bBc|bc: each a or b adds one trailing c, with positive counts of both. Thus L1 is context-free. If L2 were context-free, its inverse image under h(a)=a, h(b)=b, h(c)=cc would be {an bn cn: n≥1}, which is not context-free by the pumping lemma. CFL closure under inverse homomorphism therefore proves L2 non-context-free. Answer B.
A pushdown intuition for L1 pushes one marker per a or b and pops one per c, with finite control enforcing the a-then-b-then-c phases. L2 must enforce three linked quantities. Under h(c)=cc, an input an bn cn maps exactly to an bn c2n, transferring the known non-CFL obstruction through inverse homomorphism.