Past exam of the mathematics course of the University of Cambridge 2016 iii Paper 120 3 Solution Created 2026-10-03 Updated 2026-10-06
Rice theorem: every nontrivial extensional property of programs computing partial computable functions has an undecidable index set. More precisely, take an acceptable effective enumeration of the unary partial computable functions. If contains some but not all of these functions, then“Extensional” means that equality of partial functions, including their domains, preserves membership; no syntactic restriction on program codes is being considered.
We use two standard facts, stated explicitly. The diagonal halting set is undecidable. For the associated acceptable enumerations of -ary partial computable functions, with , the S-m-n theorem says that for every there is a total computable function such thatwhere means equality of defined values and equality of undefinedness. Thus fixed parameters in a program can be compiled into its index effectively.
Let be the nowhere-defined partial computable function. Choose a partial computable function whose membership in is opposite to that of ; this is possible by nontriviality. For each , construct the programThis is a uniform partial computation. Take an index for the binary partial computable function . The S-m-n theorem gives the total computable function with . Crucially,Even when itself is undefined, the equality of partial functions remains correct. If , this gives a many-one reduction of to ; if , it gives a many-one reduction of to the complement of . A decision procedure for would therefore decide in either case, a contradiction.
The equivalent language formulation says that every nontrivial property of computably enumerable languages depending only on the recognized language has an undecidable index set. Apply the function formulation to the property of a partial computable function that its domain has the specified language property: every computably enumerable language occurs as such a domain.
Past exam of the mathematics course of the University of Cambridge 2018 ii Paper 4 4G d Solution Created 2026-09-24 Updated 2026-10-03
No. The propertyis extensional: it depends only on the partial function computed, not on its program index. It is nontrivial, since some partial recursive functions have a nine-element domain and others do not. The Rice theorem therefore implies that its index setis undecidable. Hence
Past exam of the mathematics course of the University of Cambridge 2019 ii Paper 3 12H b Solution Created 2026-09-24 Updated 2026-10-03
Rice theorem says that every nontrivial extensional property of programs computing partial functions is undecidable. Equivalently, a nontrivial index set cannot be a computable set.
Let be such an index set. Replacing by its complement if necessary, assume that the nowhere-defined function has no index in . Since the property is nontrivial, choose an index . If membership in were decidable, we could decide the diagonal halting problem as follows. For each , defineBy the S-m-n theorem, a total computable function produces an index for . If diverges, then is nowhere defined and . If it halts, then and extensionality gives . A decider for would therefore decide whether halts, a contradiction. Hence is undecidable.
Past exam of the mathematics course of the University of Cambridge 2019 ii Paper 3 12H e Solution Created 2026-09-24 Updated 2026-10-03
No. The propertyis an index set: it depends only on the domain of the partial function computed, not on the syntax of its program. It is nontrivial. For example, an index whose domain is a singleton belongs to , whereas an index whose domain has two elements does not. The Rice theorem therefore shows that is not a computable set, so no algorithm can decide the requested property for arbitrary .
Invoking the Church–Turing thesis, this also rules out any effective procedure in the informal sense, because such a procedure would be represented by a computable function.
Past exam of the mathematics course of the University of Cambridge 2024 ii Paper 2 4J a Solution Created 2026-09-24 Updated 2026-09-25
Past exam of the mathematics course of the University of Cambridge 2025 ii Paper 1 12F a iii Solution Created 2026-09-24 Updated 2026-09-25
Past exam of the mathematics course of the University of Cambridge 2025 ii Paper 1 12F d Solution Created 2026-09-24 Updated 2026-09-25
The set of codes of even length is not an index set because code length is syntactic rather than a property of . By the padding lemma, every computably enumerable language has equivalent machine descriptions of arbitrarily many lengths, in particular descriptions of both parities. Hence equal recognized languages need not give equal membership.