Build an infinite oracle as an increasing union of finite binary strings. With the diagonal halting set as an oracle, decide whether some finite extension makes a specified Turing functional halt with a binary output at a fresh input. In a yes case, preserve that finite computation and commit the opposing set's bit to the opposite value. In a no case, no subsequent infinite extension can yield a characteristic-function value there. Length growth makes the resulting sets computable in the halting oracle.
Pascal's rule Created 2026-10-13 Updated 2026-10-18
For an integer and any integer , Pascal's rule holds with the convention outside . The boundary values are , including . Initialize row zero separately: the recurrence relation does not require binomial coefficients with top index .[ref]
Discrete Mathematics: An Open Introduction (3rd edition) by Oscar Levin. §1.2, Recurrence relation for binomial coefficients and Pascal's Triangle: edge values and the two-parent rule
Proof by a marked element. Count the -element subsets of , marking the element as special. Those omitting are exactly the -element subsets of . From those containing , delete to obtain the -element subsets of that same smaller set; adjoining reverses this operation. The rule of sum adds these two disjoint counts. The proof includes and because the impossible class contributes zero.
For an original worked instance, choose three labels from and mark . Omitting it gives selections. Including it leaves two labels to choose from the other six, giving . Therefore . Under the bijection with north-east lattice paths to , membership of position seven says whether the final step is north: the marked-element split becomes the last-step split.
This makes Pascal's rule useful beyond an algebraic identity. A counting problem may have an obvious yes-or-no decision even when its factorial formula is obscure; splitting at that decision exposes a recurrence relation. When the smaller counts are shared between many cases, dynamic programming reuses them. The beauty of Pascal's triangle is that one local addition rule simultaneously organizes subsets, binary strings, north-east lattice paths, and the binomial theorem.
Apply one Hadamard gate to each of the qubits, with all gates acting in parallel. This quantum circuit implements the tensor product ; it needs single-qubit gates and one layer. For one qubit,Taking the tensor product of these expressions multiplies the probability amplitudes and adds their exponents, givingHere the dot product is evaluated using modular arithmetic modulo two.
In particular, an initially zero quantum register becomes the uniform quantum superpositionThis is useful at the start of a quantum algorithm because a subsequent quantum oracle acts on all these components coherently. Later quantum interference can reveal a global property of the function. Measuring immediately would merely produce a uniformly random binary string; the useful resource is the preserved quantum coherence, rather than the ability to read every function value in one run.
Past exam of the mathematics course of the University of Cambridge 2001 ia Paper 4 2E Solution Created 2026-09-24 Updated 2026-10-14
For nonnegative integers , prove the hockey-stick identity by mathematical induction on . The induction base case is . If the formula holds through , Pascal's identity givesThis supplies the inductive step.
A binary string containing exactly zeroes and ones has length . Choosing its one-positions gives possibilities. Different values of give disjoint collections, so counting binary strings with bounded ones yieldsThis includes : the strings are the empty string and the all-one strings of lengths one through .
Past exam of the mathematics course of the University of Cambridge 2012 iii Paper 24 1 Solution Created 2026-10-03 Updated 2026-10-07
Take and fix a standard effective enumeration of the unary partial computable functions by program texts. WriteThe diagonal halting set is not a computable set: a supposed decision procedure would give a program that halts on input exactly when , contradicting its own index. Each is finite and uniformly decidable by bounded simulation of a computation, and with union .
For , define the computable colouringThis is a two-part decidable set partition on three-element subsets: sort the three inputs and perform the two finite simulations. Here . The halting-stage colouring of triples cannot have an infinite homogeneous set for a colouring of colour . Indeed, fix its least element . The finitely many bits of eventually stabilize. Choose two later elements of the putative homogeneous set for a colouring beyond that stabilization stage; the corresponding triple has colour .
Now suppose is an infinite homogeneous set for a colouring of colour . Its membership oracle computes : to decide whether , search for with , and return whether . For every above , homogeneity gives . Since is unbounded, taking such arbitrarily large proves that this common finite set is . ThusIf were a computable set, the displayed Turing reduction would decide , a contradiction. The displayed decidable two-colouring has no infinite decidable homogeneous set.
For the second construction, let be the finite binary strings, with coordinates starting at , and define the computable binary treeMembership is decided by finitely many tests using bounded simulation of a computation. It is a binary tree of finite strings: if a string satisfies the tests, each prefix satisfies its shorter and fewer tests. The infinite paths through a binary tree are exactlyThis set is nonempty: at a coordinate whose diagonal computation halts with a binary value choose the other value, and choose either bit elsewhere. This is an existence argument, not a proposed computable decision procedure for convergence. No member is a total computable function. If were a total binary-valued function, the condition at would say . Thus each member is a binary diagonally noncomputable function.
Moreover, has no isolated point. There are arbitrarily large indices of programs that never halt: for example, distinct program texts with successively more unused instructions followed by an infinite loop provide infinitely many such indices in the usual syntactic program coding. At every one of these coordinates the bit is unrestricted. Given any and any prefix length , change its bit at one such index and leave all other bits unchanged. The resulting different path still belongs to and has the same length- prefix. Since a path space is closed in Cantor space, is decidable, is nonempty and perfect, and no infinite path is computable.
There is a definition issue with the adjective “perfect”. The preceding conclusion uses perfect path space, allowing finite dead ends in the decidable presentation. If “perfect tree” instead requires every node to have two incompatible extensions in the tree, the requested combination is impossible. Such a nonempty tree has no terminal nodes. Starting at the empty string, test the two immediate successors and choose the first that belongs to the tree; one always exists. This constructs a total computable function whose successive prefixes remain in the tree. Thus computable pruned binary trees have computable paths. Our necessarily has dead ends; its subtree consisting only of prefixes of infinite paths is perfect in the pruned sense but is not decidable. The construction therefore supplies the intended perfect closed path space and also resolves the stronger, inconsistent interpretation.
Past exam of the mathematics course of the University of Cambridge 2012 iii Paper 24 4 Solution Created 2026-10-03 Updated 2026-10-07
For subsets , a many-one reduction is a total computable function such thatA Turing reduction is an oracle machine that, using membership queries to , halts on every input and computes the indicator function of . It may make several adaptive queries, and need not preserve the yes/no answer to a single query. A many-one reduction yields a Turing reduction by computing and querying once. Two sets have the same Turing degree when each is Turing reducible to the other. Write for the degree of the diagonal halting set .
We prove the Kleene–Post incomparability theorem by an oracle-assisted finite-extension construction. Fix an effective list of all Turing functionals. We shall build increasing finite binary strings whose unions are the indicator functions of . A finite oracle computation means that the computation halts with output and every oracle query is strictly below . Its answers are supplied by . By the finite oracle use property, every infinite oracle extending preserves this computation.
Here is the decision available from . Given and a finite string , considerThis predicate is semidecidable: enumerate all finite extensions of and dovetail their finite oracle simulations, stopping at the first halting binary output. There is a computably produced program which, on its own index as well as on every other input, performs this search and halts exactly if it succeeds. Membership of its code in therefore decides . In a yes case, running the search finds an actual witness . The decision oracle is essential in a no case; merely waiting would not produce a terminating construction.
Start with empty strings. At stage first ensureChoose , which is not yet assigned in . Ask whether holds. If yes, find a witness , extend the current string to , and append the bit to the current string. If no, leave the current string unchanged and append to the current string. The yes case permanently forces disagreement at , since later strings extend both commitments. In the no case no final oracle extending the current string can give a binary output at : any such convergent computation would use finitely many bits and hence supply a forbidden finite witness. Thus it cannot be the indicator function of either, regardless of whether it diverges or returns a nonbinary value.
Next, using the strings just obtained, ensureby the same procedure with the roles reversed. Choose equal to the current length of the string, ask the analogous extension question about the current string, and, if it has witness output , extend to that witness and append to . Otherwise append to . Finally pad both strings with zeros if necessary so that each length is at least , and call the resulting strings . Every operation is computable using the membership oracle and terminates. Earlier disagreements remain protected because no already fixed bit is ever changed.
Set and . The length condition makes these total binary functions. To compute either bit with oracle , run the construction through stage , when both strings have length at least , and read that bit. Consequently . Every Turing functional has been defeated in both directions, soNeither set is computable, since a computable set is Turing reducible to every oracle. Neither can have degree : if , then , contrary to incomparability; the other case is symmetric. ThereforeThis proves the requested theorem. The argument does not claim or is computably enumerable; it constructs sets computable in . Obtaining incomparable computably enumerable degrees is the stronger Friedberg–Muchnik theorem, which is not needed for the printed request.
Past exam of the mathematics course of the University of Cambridge 2015 iii Paper 25 2 i Solution Created 2026-10-03 Updated 2026-10-06
An immune set is an infinite set containing no infinite computably enumerable subset. For binary strings, use an effective bijection with natural numbers when discussing enumeration. Fix an optimal description machine and define the plain Kolmogorov complexityAn incompressible string has no description shorter than itself, that is, . The choice of machine is fixed throughout the proof.
Let be the set of incompressible strings. There are strings of length , but only programs of length less than . Each halting program describes at most one string, so at least one string of each length belongs to . Consequently is infinite.
Suppose an infinite computably enumerable set were contained in . Define a total computable function by running an enumeration of until a string of length at least appears, and outputting the first such string. This search always terminates because there are only finitely many binary strings of bounded length. A fixed program can reconstruct from a self-delimiting binary code of . For example, if the binary expansion of has length , encode it using copies of one, a zero separator, and its binary digits. This givesfor a constant depending on the enumeration algorithm and the optimal description machine, not on . For sufficiently large this is less than , contradicting . Thus the set of incompressible strings is an immune set. This proves immunity of incompressible strings. The argument uses the ability to describe a selected long string by the short threshold specifying how it was selected.
Write an -bit binary string as , where each and is most significant. Its unsigned interpretation and two's complement interpretation areEquivalently, . The ranges are through and through , respectively. The same stored bits can therefore denote different integers depending on the chosen interpretation.
Plain Kolmogorov complexity 2026-10-06
For a fixed optimal description machine , the plain Kolmogorov complexity of a binary string is the minimum length of a finite program producing it. The admissible programs need not satisfy a prefix restriction. There are at most descriptions shorter than , which is the counting fact behind the existence of incompressible strings.
Power set Created 2026-09-28 Updated 2026-10-14
The power set is the set of all subsets of , including the empty set and itself. It is useful whenever an object is a selection rather than an individual member: a possible collection of active vertices in a graph, for example, belongs to the power set of the vertex set.
For , the power set has eight members:Each of the three set elements is either included or excluded. More generally, if , these independent binary choices give . This is a bijection between subsets and binary strings of length , not a probabilistic independence assumption.
Ordering the subsets by inclusion gives a Boolean lattice. In the picture an upward edge adds one member. Complementation reverses inclusion, and union and intersection combine selections. The empty-input case is worth checking: has one member, not zero, consistently with .
Quantum oracle 2026-10-25
A quantum oracle supplies coherent access to a function through a specified unitary operator. For a function with binary string output, the standard construction retains the input and adds the output into an answer quantum register by bitwise exclusive or. This operation is its own inverse, even when the function is not injective. A Boolean quantum oracle is the single-output-bit case; Simon's algorithm uses several answer qubits. Other encodings, such as a modular-addition quantum oracle or a phase gate encoding, require their own explicit query conventions.
Run-length encoding 2026-10-13
Run-length encoding replaces each maximal consecutive group of equal values, called a run, by its value and length. Decoding repeats each value the specified number of times. It is lossless source coding: no values are discarded. For a binary string, successive maximal runs alternate between 0 and 1, so storing the first bit and all run lengths is enough.
Take this raster image, with 0 black and 1 white, read left to right across each row and then top to bottom:Reading the whole image as one 64-bit binary string gives exactly seven runs:The lengths sum to . Repeating the alternating values for these lengths and splitting after every eighth pixel reconstructs every displayed row exactly.
00000000
00001111
11110000
00001111
11110000
00001111
11110000
00000000Here is a complete toy file format. Its file header is an eight-bit unsigned width, an eight-bit unsigned height, then a one-bit mode: 0 means raw pixels, 1 means run-length encoding. Fields are written most significant bit first; this profile accepts only width and height 8, so both decoders know to stop at 64 pixels. Raw mode contains 64 bits. RLE mode contains the initial bit, followed by seven-bit unsigned run lengths in the range 1 to 64. Zero and lengths above 64 are invalid; a decoder rejects a run that would exceed the remaining pixel count. It stops when the decoded lengths sum to 64, so no run-count field or end marker is needed.
For this image, the complete RLE serialization is:Spaces and vertical bars are explanatory separators, not stored characters. The seven-bit fields directly store the lengths; 64 would be
00001000 00001000 1 | 0 | 0001100 0001000 0001000 0001000 0001000 0001000 00011001000000. The payload costs bits, versus 64 raw bits. The 17-bit file header has the same size in either mode, giving complete sizes of 67 versus 81 bits. If packed into eight-bit units, append zero padding only at the end: the sizes become 72 versus 88 bits. These are sizes of this toy representation, not sizes of PNG files.The field design matters. Restarting RLE on every row costs eight initial bits plus four bits per run when lengths are stored directly: three bits represent only 0 through 7, whereas a row can have length 8. This pattern has row-run counts , totalling 14, so that payload costs bits, with no saving. Storing length minus one would instead fit lengths 1 through 8 into three bits, but is a different declared file format. An alternating flat 64-bit binary string has 64 runs and costs payload bits in our flat format; restarting each row costs payload bits. A one-run image costs only eight payload bits. These extremes explain when RLE is useful: long uninterrupted regions make short instructions, while frequent changes make instructions expensive.
Prefix codes of unequal lengths can replace fixed-width run lengths, provided the decoder knows the code and any necessary code description is counted. Run-length encoding names a technique, not one universal serialization. For a real implementation, Microsoft's bitmap documentation specifies
BI_RLE8 with count and value fields plus special commands, rather than our initial-bit convention.[ref]https://learn.microsoft.com/en-us/windows/win32/gdi/bitmap-compression. Microsoft, Bitmap Compression, BI_RLE8 encoded and absolute modes
Simon's algorithm Created 2026-09-28 Updated 2026-10-25
Simon's algorithm prepares hidden-subgroup coset states, applies the quantum Fourier transform over , and samples vectors satisfying over . Repeated samples and Gaussian elimination recover with oracle queries and polynomial computation.
To solve Simon's problem, prepare a uniform quantum superposition, evaluate the function coherently into a second quantum register, and perform Simon Fourier sampling on the first. Each run produces a uniform binary string with over the two-element field. Once the observed rows have matrix rank , Gaussian elimination recovers as the unique nonzero element of their kernel. The random spanning of a binary vector space bounds the required number of runs.
Universal lossless shortening is impossible 2026-10-13
Fix . There is no injective function from all length- binary strings to binary strings of length strictly less than . There are possible inputs, but even allowing the empty string gives onlypossible shorter outputs. The finite geometric series and pigeonhole principle leave at least two inputs sharing an output, which prevents exact decoding. For , eight inputs compete for the empty string and the six strings
0, 1, 00, 01, 10, 11.This counting argument includes any file header or other information sent to the decoder. An algorithm chosen separately for each input must also be identified to the receiver; its description is not free. A useful compressor saves space on some inputs while leaving others unchanged or making them longer. Lossy compression avoids the exact-recovery requirement by deliberately allowing several inputs to share an output.
Unsigned interpretation of a bit string 2026-10-25
For an -bit binary string , the unsigned interpretation assigns positive positional weights to its bits. Its values range from zero to . The same stored bits have two's complement value , so interpreting a machine word is a separate choice from storing its bits.
Verifying a satisfying assignment Created 2026-10-18 Updated 2026-10-25
For a CNF input with Boolean variables, Boolean clauses, and Boolean literal occurrences, first check that the supplied Boolean valuation gives each input Boolean variable exactly one truth value. Evaluate each Boolean literal by lookup or logical negation, each Boolean clause by logical disjunction, and the Boolean formula by logical conjunction. Indexed Boolean variables and constant-cost lookups give an operation count; with a finite binary string encoding the check still takes polynomial time. Thus a satisfying assignment is a certificate in computational complexity for SAT, proving that SAT belongs to NP. Finding it by exhaustive checking can require candidate Boolean valuations; this enumeration cost is not a lower bound on every possible SAT algorithm.[ref]
CS 252, Lecture 8: Constraint Satisfaction Problems (Carnegie Mellon University). CS 252, Lecture 8: Constraint Satisfaction Problems, p. 3, §3 opening paragraph: assignments as certificates and membership in NP


