Definir algunas funciones básicas:
pni:Nn→N:(x1,x2,…,xn)↦xi
De ahora en adelante para denotar ( x 1 , x 2 , … , x n )xn¯(x1,x2,…,xn)
Definir una composición:
Funciones dadas
- cada uno con la firma N k → Ng1,g2,…,gmNk→N
- f:Nm→N
Construya la siguiente función:
h:Nk→N:xk¯↦h(xk¯)=f(g1(xk¯),g2(xk¯),…,gm(xk¯))
Definir recursividad primitiva:
Funciones dadas
- f:Nk→N
- g:Nk+2→N
Construya la siguiente función (por partes):
h:Nk+1→N:(xk¯,y+1)↦{f(xk¯),g(xk¯,y,h(xk¯,y)),y+1=0y+1>0
Todas las funciones que pueden realizarse utilizando composiciones y recursividad primitiva en funciones básicas , se denominan primitivas recursivas . Se llama así por definición. Si bien existe un enlace con funciones que se llaman a sí mismas, no hay necesidad de intentar vincularlas entre sí. Puede considerar la recursión como un homónimo.
Esta definición y construcción anterior fue construida por Gödel (algunas otras personas también estuvieron involucradas) en un intento de capturar todas las funciones que son computables, es decir, existe una Máquina de Turing para esa función. Tenga en cuenta que el concepto de una máquina de Turing aún no se describió, o al menos era muy vago.
(Des) afortunadamente, alguien llamado Ackermann vino y definió la siguiente función:
- Ack:N2→N
- Ack(0,y)=y+1
- Ack(x+1,0)=Ack(x,1)
- Ack(x+1,y+1)=Ack(x,Ack(x+1,y))
This function is computable, but there's no way to construct it using only the constructions above! (i.e. Ack is not primitive recursive) This means that Gödel and his posse failed to capture all computable functions in their construction!
Gödel had to expand his class of functions so Ack could be constructed.
He did this by defining the following:
Unbounded minimisation
- g:Nk→N
- IF [f(xk¯,y)=0 AND f(xk¯,z) is defined ∀z<y AND f(xk¯,z)≠0]
THEN
g(xk¯)=y
ELSE
g(xk¯) is not defined.
This last one may be hard to grasp, but it basically means that g((x1,x2,…,xk)) is the smallest root of f (if a root exists).
All functions that can be constructed with all the constructions defined above are called recursive. Again, the name recursive is just by definition, and it doesn't necessarily have correlation with functions that call themselves. Truly, consider it a homonym.
Recursive functions can be either partial recursive functions or total recursive functions. All partial recursive functions are total recursive functions. All primitive recursive functions are total. As an example of a partial recursive function that is not total, consider the minimisation of the successor function. The successor function doesn't have roots, so its minimisation is not defined. An example of a total recursive function (which uses minimisation) is Ack.
Now Gödel was able to construct the Ack function as well with his expanded class of functions. As a matter of fact, every function that can be computed by a Turing machine, can be represented by using the constructions above and vice versa, every construction can be represented by a Turing machine.
If you're intrigued, you could try to make Gödel's class bigger. You can try to define the 'opposite' of unbounded minimisation. That is, unbounded maximisation i.e. the function that finds the biggest root. However, you may find that computing that function is hard (impossible). You can read into the Busy Beaver Problem, which tries to apply unbounded maximisation.