Bounded halting predicate Created 2026-10-06 Updated 2026-10-07
For a fixed effective machine coding, the predicate that program on input halts within steps is primitive recursive. Code finite configurations, iterate a total single-step function by primitive recursion, and test for the halt state. This supplies a bounded simulation even though the unrestricted halting problem is undecidable.
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 20 2 i Solution Created 2026-10-03 Updated 2026-10-07
If halts on every input, simulate on input while counting its steps, and output that count when it halts. The resulting function is a total computable function. Consequently yes: one may take the exact running time,This construction does not promise a simple closed expression or a bound of any particular complexity class; it uses the promised totality of this particular machine.
For a machine computing a partial computable function, its exact halting-time function is still a partial computable function, with the same domain. A finite bound cannot cover a genuinely infinite computation. Even restricting attention to inputs on which halts, a total computable function bounding all halting times need not exist. In fact the precise characterization is the computable bound on halting time criterion:For the forward implication, compute and simulate for that many steps. If it has not halted, the proposed bound ensures that it never will. This decides the domain. Conversely, first decide whether is in the domain; return zero outside it and the simulated halting time inside it. This defines a total computable function satisfying the bound. The time needed to compute the bound itself is irrelevant to this argument.
A universal halting recognizer has undecidable domain by the halting problem, so it has no such total bound. On the other hand, a machine that immediately halts on even inputs and loops on odd inputs computes a nontotal partial computable function but has a constant bound on its halting times. Thus nontotality alone does not decide whether a total bound exists.
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 59 3 a Solution Created 2026-10-03 Updated 2026-10-07
A circuit size class consists of languages whose length- indicator functions have Boolean circuits of size at most , for all sufficiently large , over a fixed finite bounded-fan-in complete basis. The notation allows a constant factor. Input-node counting conventions do not affect the polynomial and exponential bounds here.
The nonuniform class P/poly isThere is no requirement that a uniform algorithm construct the Boolean circuits. Equivalently, a polynomial-time machine can receive polynomial-length advice depending only on the input length, and the advice need not be computable.
Choose an undecidable set , for example the set in the halting problem of indices of machines that halt on empty input, and define . For each length , use a constant-zero Boolean circuit if , and an AND of all input bits if . These Boolean circuits have size and accept exactly . Thus undecidable unary languages with linear-size circuits belong to P/poly.
Every NP language is decidable by enumerating its finitely many polynomial-length certificate encodings and running the polynomial-time verifier. If were decidable, testing would decide , a contradiction. ThereforeThis separates the classes in the stated direction; it does not claim that NP is not contained in P/poly.
Past exam of the mathematics course of the University of Cambridge 2017 iii Paper 135 2 Solution Created 2026-10-03 Updated 2026-10-05
For subsets , a many-one reduction is a total computable function with . A Turing reduction is an oracle machine with oracle computing the total indicator function . It may make several adaptive oracle queries. A many-one reduction gives a Turing reduction using one query; the definitions impose no enumerability assumption on .
The Friedberg–Muchnik theorem asserts that there exist computably enumerable sets withWe give the finite-injury priority construction. Fix an effective list of Turing functionals and imposein priority order . Each strategy has an unassigned, waiting or protected state; a private witness when assigned; and a restraint on the oracle set when protected. All witnesses, even abandoned ones, are permanently recorded and never reused. A strategy for is the only strategy ever allowed to enumerate its witness into ; the analogous statement holds for and .
Start with finite sets . At stage , inspect the first strategies. An unassigned strategy needs attention. A waiting strategy needs attention if the computation converges within steps; waiting is symmetric. Act on the highest-priority strategy needing attention, if any. On assignment choose a fresh witness greater than , every earlier witness and every higher-priority restraint, and enter the waiting state. On a convergence with output and oracle use , act as follows: if , enumerate the witness into its own target set; if , leave the witness out. Enter the protected state and restrain the oracle below . The current characteristic value at the witness is now different from , including outputs other than zero or one. Whenever a strategy acts, initialize every lower-priority strategy, discarding its current witness and restraint but retaining the permanent record of used witnesses. If none needs attention, change nothing.
Every enumeration respects higher-priority restraints: its witness was chosen beyond them after its last initialization, and a later higher-priority action would have initialized it. Each stage is effective, finite and monotone in , so and are computably enumerable. Lower-priority restraints may be violated by a higher-priority action, exactly the allowed injuries.
Induct on priority to verify finite injury and satisfaction. Once all higher-priority strategies have made their last actions, the current strategy receives its final assignment and can act at most once more, on a convergence. If convergence is observed it is then protected permanently; otherwise it waits without further action. In either case every strategy acts only finitely often. After the final initialization of , if it acts on a convergence, no higher strategy subsequently changes its assumptions and every lower strategy respects its restraint. The observed oracle computation therefore remains valid for the final , while the permanently private witness retains the opposite characteristic value in .
If it waits forever, then cannot converge. A convergent final computation uses only finitely many oracle bits; those bits in the increasing enumeration eventually equal their final values. For a sufficiently large stage the same finite computation would have been observed, and after the higher strategies have stopped it would receive attention, contradicting perpetual waiting. Thus is satisfied either by disagreement or by divergence. The same proof satisfies every . This is private-witness diagonalization for incomparable enumerable sets, with the finite-injury verification supplying the required permanent disagreements.
A computable set reduces to every oracle, so incomparability makes both sets noncomputable. Every computably enumerable set reduces to the halting problem; if either of these sets had the halting degree, the other would reduce to it. Thus their c.e. degrees are also incomplete, giving the intermediate degrees sought by the Post problem.
Past exam of the mathematics course of the University of Cambridge 2017 ii Paper 3 11H b Solution Created 2026-09-24 Updated 2026-10-05
The S-m-n theorem says that parameters can be compiled effectively into program indices: for a standard effective numbering, there is a total computable function with for partial computable functions of arguments.
Write , a recursively enumerable halting problem. If is recursively enumerable, make a program with parameter which ignores its input and runs a semidecision procedure for , halting when that procedure halts. By the S-m-n theorem its index is total computable and . Conversely, implies that is recursively enumerable by the previous construction. Thus .
Past exam of the mathematics course of the University of Cambridge 2018 iii Paper 135 4 Solution Created 2026-10-03 Updated 2026-10-05
A many-one reduction is a total computable function with . A Turing reduction is an oracle machine which decides with oracle . It may make several adaptive queries and combine their answers. Every many-one reduction is a Turing reduction, by asking the single question . The converse fails: for the diagonal halting set , its complement is Turing-reducible to by reversing one oracle answer, but is not many-one reducible to . Such a reduction would make the complement computably enumerable, contradicting undecidability of the halting problem.
The Friedberg–Muchnik theorem asserts that there are computably enumerable sets with incomparable Turing degrees:Here is a finite-injury priority construction proving it. Enumerate all Turing functionals and put the requirements in the priority orderStart with . Each requirement has a fresh witness, a waiting or acted status, and a restraint on the other set. A restraint forbids lower-priority strategies from enumerating numbers below into that oracle. Globally remember all previously chosen witnesses, including abandoned ones, and never choose any of them again.
For , choose an unused witness outside , larger than the stage and every current higher-priority restraint. Keep it out of . Wait until the bounded simulation converges with value zero. If this happens, enumerate into , put a restraint on , where is one more than the largest oracle query in the observed computation, and mark the strategy acted. For , interchange and .
At stage , consider the first requirements. Choose the highest-priority one needing a witness or waiting with an observed zero computation. Perform its indicated action, then initialize all lower-priority requirements: abandon their witnesses, clear their restraints, and reset their status. Do nothing if no requirement needs attention. Since witness selection respects higher restraints, and higher actions initialize every lower strategy, all protected computations are respected by lower-priority enumerations. Each stage is a finite effective calculation, so and are computably enumerable sets.
Verify by induction along the priority order that every requirement is initialized only finitely often and acts only finitely often. The highest requirement chooses one witness and can diagonalize at most once. After all higher requirements have finished acting, the next requirement is never again initialized; it obtains a final witness and can diagonalize at most once. This proves finite injury for every requirement and ensures that no requirement is permanently starved by higher attention.
Consider after its last initialization. If it acts, its witness belongs to , while the protected computation with oracle remains zero: higher strategies no longer act and lower ones respect its restraint. Thus . If it never acts, its private witness remains outside . Were , the computation on that witness would converge to zero with a finite oracle use. Since the increasing sets eventually agree with on this finite initial segment, a sufficiently late bounded simulation would detect that computation and make act, a contradiction. The symmetric argument verifies every .
Thus the two sets have incomparable Turing degrees. Both are noncomputable, since a computable set is Turing-reducible to every oracle. Both are also strictly below the degree of the halting problem: every computably enumerable set is Turing-reducible to , while completeness of one would make the other reducible to it. This supplies the intermediate degrees sought in Post problem.
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 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 2 4F ii Solution Created 2026-09-24 Updated 2026-09-29
The setis the diagonal halting set. It is recursively enumerable by simulating the coded machine, but it is not recursive by the halting problem diagonal argument.
By contrast, is recursive: decode , reject it if it is not a program code, otherwise simulate the program on input for exactly steps and accept precisely if it has halted. This bounded computation always terminates. Thus
Past exam of the mathematics course of the University of Cambridge 2022 ii Paper 1 4I Solution Created 2026-09-23 Updated 2026-09-25
Fix an effective enumeration of register-machine programs. The th register machine is , and its domainis the th recursively enumerable set. A many-one reduction is a total computable function satisfying . Rice theorem says that every nontrivial property depending only on the computed partial function, or equivalently on an r.e. set in its extensional form, has an undecidable index set.
There is no total equality algorithm: it would decide whether is empty by comparing it with a fixed index for the empty set, contradicting Rice's theorem.
There is no partial algorithm that halts exactly when either. Given , effectively construct an index whose machine enumerates nothing unless halts, after which it enumerates . ThenA semialgorithm for equality with a fixed empty index would enumerate the complement of the halting problem . Since is r.e., both it and its complement would then be r.e., making recursive, a contradiction.
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.
Post problem Created 2026-10-05 Updated 2026-10-07
Post problem asks whether a computably enumerable set can have a Turing degree strictly between the computable degree and the degree of the halting problem. The Friedberg–Muchnik theorem answers yes by constructing two incomparable computably enumerable degrees.