Past exam of the mathematics course of the University of Cambridge 2023 ii Paper 1 4I a Solution Created 2026-09-24 Updated 2026-09-25
A context-free grammar is in Chomsky normal form when every production is of one of the formswhere are nonterminal symbols and is a terminal symbol. The conventional exceptional production may be allowed when the language contains the empty word, with excluded from right-hand sides.
Past exam of the mathematics course of the University of Cambridge 2024 ii Paper 1 4J a Solution Created 2026-09-24 Updated 2026-09-25
Take the productionsand the word . There is only one parse tree: its root uses and each child uses . There are nevertheless exactly two derivations,andaccording as the left or right occurrence of is replaced first. This illustrates that derivations record replacement order while a context-free grammar parse tree does not.
Production rule 2026-09-29
A production rule specifies a permitted replacement during a grammar derivation. In a context-free grammar it has the form , with one nonterminal on the left.