Past exam of the mathematics course of the University of Cambridge 2019 ii Paper 4 4H a i Solution Created 2026-09-24 Updated 2026-10-03
LetIntersect it with the regular languageEvery word of contains exactly two copies of . If it is a proper power, its exponent must therefore be two and its root must contain one . HenceThis language is not regular: if were a pumping length, pumping any nonempty substring among the first copies of in would change only its first -block. Since regular languages are closed under intersection,This is the proper-power language is not regular.
Past exam of the mathematics course of the University of Cambridge 2019 ii Paper 4 4H b Solution Created 2026-09-24 Updated 2026-10-03
Let be the undecidable set denoted in the question. The language satisfies the pumping lemma for regular languages with pumping length one. For any nonempty , write with , its first symbol, and the remaining suffix.
If , then for every . Otherwise for some . If the chosen first symbol lies in , pumping it preserves the same final suffix . If , then : pumping down gives , while every positive pump gives and all but its last can be absorbed into . Thus every sufficiently long word has a valid pumping decomposition.
Nevertheless, if were regular language, closure under intersection would makeregular. A finite automaton deciding this unary language would decide whether by running it on , contradicting the halting problem. ThereforeThis is a nonregular language satisfying the pumping lemma.
Past exam of the mathematics course of the University of Cambridge 2020 ii Paper 3 12F Solution Created 2026-09-24 Updated 2026-09-29
A deterministic finite automaton is a tuple with finite state set , finite input alphabet , transition function , initial state , and accepting-state set . It accepts a word when the extended transition function of a deterministic finite automaton carries to a state in . A regular language is a language accepted by some deterministic finite automaton.
The pumping lemma for regular languages says that if a regular language is accepted by an automaton with states, every accepted word of length at least has a decomposition with , , and in the language for every . Indeed, among the states visited before and after the first symbols, two are equal by the pigeonhole principle. The intervening nonempty word labels a loop, which may be traversed any number of times without changing the final accepting state.
In base two, the powers of two have representations , so their language is the regular expression and is regular.
Suppose instead that their base-ten representations formed a regular language. Apply the pumping lemma to a sufficiently long decimal power of two , and put . Pumping gives decimal integers represented by , all powers of two. A direct place-value calculation shows thatfor a constant independent of . The lengths, and hence the exponents in , tend to infinity. Dividing by givesFor large , the right side has absolute value less than one while the left side is an integer, so it must vanish. This would make a power of two equal to , impossible for by unique prime factorization. Thus the decimal powers of two are not a regular language.
Past exam of the mathematics course of the University of Cambridge 2021 iii Paper 120 1 Solution 2026-09-28
The Knaster-Tarski theorem states that the fixed points of a monotone map on a complete lattice form a complete lattice. LetFor every , monotonicity gives , hence . Applying once more gives , so . The definition of then gives , and therefore . Thusis the least fixed point. The order-dual argument shows thatis the greatest fixed point.
More generally, for a family of fixed points, let be the set of prefixed points satisfying and for every . Its meet is again prefixed. Since for every , the element also lies in , so the preceding argument gives . It is the join of within the fixed-point order. The dual construction gives the meet of within that order, proving completeness.
For the Myhill-Nerode theorem, let and define the Myhill-Nerode equivalenceThis is an equivalence relation and a right congruence: implies for every letter .
If a deterministic finite automaton accepts , any two words reaching the same state are equivalent, because every continuation has the same subsequent run. Hence has at most as many classes as the automaton has states. Conversely, if has finitely many classes, define an automaton with state set , initial state , transitionand accepting states with . Right congruence makes the transition well defined, and induction on word length shows that the state reached by is , so the automaton accepts exactly . Therefore is a regular language exactly when has finite index. Moreover, every automaton for has at least one state for each equivalence class, so this quotient is the minimal deterministic finite automaton.
Past exam of the mathematics course of the University of Cambridge 2022 ii Paper 2 4I iii Solution Created 2026-09-24 Updated 2026-09-25
This language is not regular. If it were regular, its intersection with the regular language would be regular because regular languages are closed under intersection. That intersection is exactlywhich part (ii) proved nonregular.
Past exam of the mathematics course of the University of Cambridge 2023 ii Paper 3 12I iv Solution Created 2026-09-24 Updated 2026-09-25
Suppose first that is a regular language, accepted by a deterministic finite automaton . If two words reach the same state, then every continuation is accepted from both or rejected from both. Thus they are equivalent under , and the number of equivalence classes is at most the finite number of states of .
Conversely, suppose has finitely many classes. Define a deterministic automaton byandThe transition is well defined: if , then for every suffix ,so . Likewise, membership in is independent of the representative by taking the empty suffix in the definition of . Induction givesso the automaton accepts exactly . It has finitely many states, and therefore is regular. This proves the Myhill-Nerode theorem in the stated formulation. The assumption merely says that the initial state is not accepting.
Past exam of the mathematics course of the University of Cambridge 2026 iii Paper 120 3 g Solution Created 2026-09-24 Updated 2026-09-25
Given a finite input word , construct the typed term effectively and beta-normalize it. The Strong normalization theorem for simply typed lambda calculus guarantees termination, and confluence gives exactly one of the finitely many normal forms . Compare that normal form syntactically with the listed accepting states in . This algorithm accepts exactly when , so is recursive. Equivalently, this is the standard theorem that every language recognized by a deterministic finite automaton is a regular language and hence decidable.
Proper-power language is not regular 2026-10-03
Over an alphabet containing , the language is not regular language. Intersecting it with the regular language gives exactlywhich fails the pumping lemma for regular languages.
Right-linear grammar 2026-10-05
A right-linear grammar has productions of the form or , where are nonterminals and is a terminal word, possibly empty. Each right-hand side has at most one nonterminal, at its right end. Such grammars generate exactly regular languages: regard nonterminals as states and expand each terminal word into a finite path to another state or an accepting endpoint. Conversely the transition graph of a deterministic finite automaton gives these productions directly.
Shuffle of formal languages 2026-10-06
The shuffle of two formal languages consists of words whose positions can be partitioned into two subsequences, each preserving its order, with the two resulting words belonging to the respective languages. For regular languages, a product-state nondeterministic finite automaton advances exactly one coordinate for each letter. Common letters allow either choice; the powerset construction proves closure.
Unary context-free language is regular 2026-10-03
Every context-free language over a one-symbol alphabet is a regular language. Equivalently, the set of word lengths of a unary context-free language is ultimately periodic. This follows, for example, from the one-dimensional case of Parikh's theorem.