Similar questions 2 more →
Context-Free Grammars & Languages

Answer & solution
Official answer: 179
Approach: In Chomsky Normal Form, a nonempty derivation uses binary-variable rules A→BC and terminal rules A→a. Count each kind using the final word length.
1. The word contains 30+30+30=90 terminal symbols. Each requires exactly one terminal-producing rule application, so there are 90 such applications.
2. Initially there is one variable occurrence. Each binary rule replaces one variable with two and therefore increases the total number of current symbol occurrences by one. Terminal rules replace one symbol with one and do not change that total.
3. To grow from one symbol to a final string of 90 symbols requires exactly 89 binary-rule applications. Equivalently, the variable branching tree is full binary with 90 leaves and 89 internal branching nodes.
4. Total rule applications =90+89=179.
Answer: 179. The ten available variable names can be reused and do not bound the number of variable occurrences. Derivation order does not change these counts; the CNF epsilon exception is irrelevant to this nonempty word.