Past exam of the mathematics course of the University of Cambridge 2023 ii Paper 3 4I c Solution Created 2026-09-24 Updated 2026-09-25
Two formal grammars over the same terminal alphabet are isomorphic when there is a bijection between their nonterminals such that andwhere is extended to words by fixing each terminal and acting symbol by symbol.
Past exam of the mathematics course of the University of Cambridge 2023 ii Paper 3 4I d iii Solution Created 2026-09-24 Updated 2026-09-25
In the second grammar, is a nonproductive nonterminal: every right-hand side of a -production still contains a . Consequently the branch never yields a terminal word. Every terminal derivation from instead uses repeatedly and ends with , soThe grammars are therefore equivalent, although they are not isomorphic.
Past exam of the mathematics course of the University of Cambridge 2023 ii Paper 3 4I d i Solution Created 2026-09-24 Updated 2026-09-25
The grammars are isomorphic. The bijectionmaps every production of to the corresponding production of . They are therefore equivalent. Notice that in the first grammar and in the second are unreachable; the isomorphism also preserves this irrelevant component.