Similar questions 1 more →
Context-Free Grammars & Languages

Answer & solution
Official answer: B, C
Approach: Count how each production changes both the terminal totals and the outstanding nonterminals.
1. Derivation. Let u count applications of S→aS and v count applications of S→aSbS. Then na=u+v and nb=v. A derivation starts with one S; unary rules leave the number of outstanding S unchanged, binary rules increase it by one, and S→c decreases it by one. Thus nc=v+1, proving C. Also na≥v=nc−1>nc−2, proving B. A fails for w=c, where both a and b counts are 0; D also fails for c, whose c count is 1 and b count 0.
2. Explanation and checks. Each binary rule contributes one b and creates one additional S requiring eventual termination by a c-rule. Starting with one S therefore requires exactly one more terminating c-rule than binary rules. Unary aS rules can add any extra a’s without changing b or c counts. Consequently na−nb equals their nonnegative number; it may be zero, so A’s strict inequality is too strong. In B the weaker strict bound still holds because na≥nc−1 is an integer stronger than na>nc−2.