Computable function


 * "Recursive" redirects here. You may be looking for recursion.

Suppose we have a two-color Turing machine \(T\).

Given a positive integer \(n\), we set the tape to be blank except for \(n\) consecutive ones with the leftmost one at the position of the TM head. We simulate the Turing machine, and one of the following happens:


 * It halts with \(m \in \mathbb{N}\) consecutive ones on the tape, with the head positioned on the leftmost one. In this case we say that \(T\) outputs \(m\) given input \(n\).
 * It halts, but it does not have the configuration described above.
 * It does not halt.

Let \(f\) be the set of all ordered pairs \((m,n)\) for which \(T\) outputs \(m\) given input \(n\). We can see that \(f\) is a partial function with domain space and codomain \(\mathbb{N}\). Every such function \(f\) is called a partial computable function (or partial recursive function).

A computable function (or recursive function) is a partial computable function that is total. That is, a computable function is a function that can be computed with a Turing machine. A function \(f: \mathbb{N} \mapsto \mathbb{N}\) which is not computable is called uncomputable.

There exist functions that eventually dominate all computable functions, the most famous example being the busy beaver function. Such functions are necessarily uncomputable, and grow extremely fast. It is important to note that not all uncomputable functions have this property - an example would be the function \(h(n)\) defined as \(1\) if the \(n\)th (in some fixed ordering) Turing machine halts, and \(0\) otherwise.

Almost all functions over the natural numbers are uncomputable — there are countably many computable functions and uncountably many functions over the natural numbers.

Properties of computable functions
The set of computable functions is closed under composition.

Notable uncomputable functions

 * Busy beaver function
 * Doodle function
 * Xi function
 * Rayo's function
 * FOOT function