Past exam of the mathematics course of the University of Cambridge 2021 ii Paper 1 4F Solution Created 2026-09-24 Updated 2026-09-25
The S-m-n theorem states that for every there is a total computable function satisfyingwhenever either side is defined.
Suppose first that is recursively enumerable. Choose a program that halts exactly on inputs in , and let index a two-variable program that, on , ignores and runs that program on . By the S-m-n theorem,is total computable and indexes the unary functionThereforeThus .
Conversely, suppose through a total computable . On input , compute and simulate machine on its own code. This procedure halts exactly when , equivalently exactly when . Hence is recursively enumerable. We have proved the many-one completeness of the halting problem:
Past exam of the mathematics course of the University of Cambridge 2023 ii Paper 1 12I iv Solution Created 2026-09-24 Updated 2026-10-03
For an effective enumeration of the computably enumerable languages, the diagonal halting problem isEquivalently, if is the unary partial function coded by , thenThus is the diagonal halting set.
Undecidable decision problem Created 2026-10-05 Updated 2026-10-06
A decision problem for which no algorithm terminates with the correct yes-or-no answer on every input. For example, if the diagonal halting set had a decision algorithm, a program could halt on its own code exactly when that algorithm says it does not halt, producing a contradiction. An undecidable decision problem may still admit a partial procedure that terminates on every yes-instance.