Multiplicative block-count language 2026-10-31
This formal language is not a context-free language. For pumping length , use . A pumpable window of length at most cannot meet both outer blocks. If pumping adds copies of , then and . Preserving the product constraint would require , impossible both when and when it is positive. This contradicts the pumping lemma for context-free languages.
No: regular languages are not closed under countably infinite intersection. Let and putThe first term in has regular expression , where the fixed power means copies. The second term is a finite language, a finite union of single words. Their union is therefore a regular language.
If , then for each either or belongs to the second term, so . If , choose . It belongs to neither term of . ConsequentlyThe formal language is not a regular language. Indeed, for a proposed pumping length , the pumping lemma for regular languages applied to must pump a nonempty block consisting only of zeros. Repeating that block increases the number of zeros without increasing the number of ones, leaving . This contradiction proves the counterexample. Finite intersection closure does not extend to this infinite intersection of regular languages.
Every generated word satisfieswhere count occurrences of the indicated terminal symbols. To see this, follow the unique chain of occurrences in a parse tree. Each use of introduces one from , at least one from its rightmost , and possibly one further from . Each use of adds one and no . The terminating contributes neither. Hence no generated word has more symbols than symbols.
Also, for every , the word is generated: apply exactly times, choose each time, then use and all remaining .
Suppose were a regular language, and let be a pumping length from the pumping lemma for regular languages. Apply it to . Every allowed decomposition with and has for some . Pumping twice giveswhich violates the proved counting inequality and hence is not generated. This contradicts the pumping lemma for regular languages. Therefore is not a regular language. Ambiguity was not used: the obstruction is the unbounded constraint on symbol counts.
The formal language is not a context-free language. Suppose otherwise, and let be a pumping length from the pumping lemma for context-free languages. ChooseThis word belongs to the formal language, since its middle exponent is the product of the two outer exponents. The pumping lemma for context-free languages would givewith in the formal language for every integer .
Let be the respective numbers of symbols in the two pumped pieces together. The window cannot contain both an and a : it would have to contain the entire middle block of length , plus at least those two outer symbols, exceeding . HencePump once extra, taking . The resulting symbol counts are , , and . A necessary condition for membership, regardless of whether the block order survives, iswhere was used.
If , then , contradicting that equality. If , thenagain contradicting it. Thus every permissible decomposition fails at . This contradicts the pumping lemma for context-free languages and proves the claim. The obstruction is the multiplicative block-count language: a bounded local change cannot preserve the product constraint.
Past exam of the mathematics course of the University of Cambridge 2017 ii Paper 4 4H b Solution Created 2026-09-24 Updated 2026-10-05
Let be the diagonal halting set, which is undecidable. The pumping argument below actually holds for every subset ; nonregularity needs the stated convention, or at least a set of exponents whose unary language is nonregular.
The pumping lemma for regular languages holds with pumping length one. For an accepted nonempty word, pump its first symbol. A word containing only s remains in even if that symbol is deleted. If there is a zero and a nonempty prefix before its last zero, pumping the first symbol leaves the last zero and its following ones unchanged. If the word is , pumping its initial zero produces ; this is accepted for , and for it belongs to . In every case the pumped substring is nonempty and lies in the first position.
If were a regular language, closure under intersection would makeregular. A finite-state automaton for this intersection would decide membership of in the diagonal halting set by reading , a contradiction. Thus satisfies the pumping lemma but is not regular, under the usual meaning of . If were arbitrary, the printed conclusion would be false, for example for .
Past exam of the mathematics course of the University of Cambridge 2018 ii Paper 1 4G a Solution Created 2026-09-24 Updated 2026-10-03
The pumping lemma for context-free languages states that every context-free language has a pumping length such that every with can be writtenwith , , and for every integer .
Past exam of the mathematics course of the University of Cambridge 2018 ii Paper 1 4G b iii Solution Created 2026-09-24 Updated 2026-10-03
This language is not context-free. Let be a proposed pumping length and choose with . In any pumping decomposition of the unary word , pumping once more increases its length by an integer with . Butso the pumped length is not a power of three, contrary to the pumping lemma for context-free languages. This is also an instance of the fact that a unary context-free language is regular, whereas the powers of three are not ultimately periodic.
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 2020 ii Paper 3 4F ii Solution Created 2026-09-24 Updated 2026-09-29
The language is not context-free. Suppose it had pumping length in the pumping lemma for context-free languages, and apply the lemma to . Write with , , and for every .
Let and be the respective numbers of s and s in . If , pumping with or destroys equality of the two block lengths. Hence a valid decomposition would require . Pumping with would then produce , where . Butso is not a square number. This contradiction proves the square-count language is not context-free.
Three-block context-free pumping obstruction Created 2026-09-24 Updated 2026-11-05
The pumping lemma for context-free languages rules out a formal language when two pumpable pieces cannot preserve all three linked block counts. For example, let . If were a context-free language with pumping length , the word would have a decomposition with and .
The window cannot contain both an and a , because the intervening block alone has length . Pumping down to therefore leaves at least one outer block at length , while deleting at least one symbol from another block. The remaining block counts cannot all be equal, so , contrary to the pumping lemma for context-free languages. This argument uses a necessary condition for context-free languages; satisfying a pumping condition would not itself prove that a formal language is a context-free language.