Past exam of the mathematics course of the University of Cambridge 2023 ii Paper 1 4I c Solution Created 2026-09-24 Updated 2026-10-03
One parse tree can be recorded unambiguously by the nested expressionEvery internal node uses one of the given productions, and the leaves read from left to right areEquivalently, the corresponding leftmost grammar derivation isHence the required word is generated by the grammar.
Past exam of the mathematics course of the University of Cambridge 2023 ii Paper 3 4I a Solution Created 2026-09-24 Updated 2026-10-03
For the formal grammar ,Thus contains exactly the finite terminal words reachable from the start symbol by a finite grammar derivation.
Past exam of the mathematics course of the University of Cambridge 2023 ii Paper 4 4I ii Solution Created 2026-09-24 Updated 2026-09-25
We prove the claim by induction on the length of the grammar derivation from . At length zero the sentential form is , which has the required form.
Suppose the current sentential form is . Because is terminal, the only symbol to which a production can apply is . A production producesagain a terminal word followed by one variable. A production produces the terminal word . Once a completely terminal word is reached, no further production can apply. The induction proves the sentential form of a right-linear regular grammar: every reachable is either or .
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.