Context-Free Grammars & Languages

Answer & solution
Official answer: D
1. I is false. If L1 were context-free, choose a prime q above its pumping length. Any pumping decomposition increases the unary length by a positive d when pumped once extra. Pumping q extra copies gives length q+qd=q(1+d), a composite number, contradicting membership.
2. II is false: a CFG for L2 is S→aS|B and B→bBcc|ε. It independently generates any number of a symbols, then matches each b with two c symbols.
3. III is true. L3 is decidable by checking symbol order and counting the three runs. If it were CFL, inverse homomorphism under h(a)=a,h(b)=b,h(c)=cc would make {an bn cn} context-free, a contradiction to that standard non-CFL result. IV is true: a deterministic PDA pushes for a symbols, switches on the first b and pops for each b, accepting exactly matching positive counts. Therefore III and IV, D.