Nonproductive nonterminal Created 2026-09-24 Updated 2026-09-24
Past exam of the mathematics course of the University of Cambridge 2023 ii Paper 3 4I d ii Solution Created 2026-09-24 Updated 2026-10-03
The grammars are non-equivalent. In the first grammar, terminal derivations without giveAfter applying any number of times while and remain adjacent, the production also givesHence, in particular, and .
In the second grammar, the fixed terminals in prevent and from ever becoming adjacent, so can never be used. The remaining productions give exactlyThus , proving that the generated languages differ.
Unreachable nonterminal Created 2026-09-24 Updated 2026-09-24
A nonterminal is unreachable when no word derivable from the start symbol contains it. Productions whose left sides are unreachable do not affect the generated language.