Questions tagged [ackermann-function]

An example of a total computable function that is not primitive recursive; appears in the literature in many variants. The original three-argument variant can be used to define the Ackermann numbers.

The three argument version originally due to Ackermann is defined as follows.

Let $\varphi$ take three non-negative integers $m,n,p$ as arguments. We define

$$\begin{align} \varphi(m,n,0) &= m + n \\ \varphi(m,n,1) &= m \times n \\ \varphi(m,n,2) &= m^n\end{align}$$

This can be extended to the higher values of $p$ by the description

$$ \varphi(m,n,p+1) = \underbrace{\varphi(m,\varphi(m,\varphi(m,\varphi(\dots}_{\text{Nested }~ n-1~ \text{ times}}),p),p),p) $$

Thus for $p = 3$ this defines the operation, and for $p > 3$ this continues the natural generalisation.


While the above serve as a good description of the Ackermann function, the original recursive definition, without the need of the cumbersome underbrace shown in the formula above, is the following:

$$ \varphi(m,n,p) = \begin{cases} m+n & p = 0\\ 0 & n = 0, p = 1\\ 1 & n = 0, p = 2\\ m & n = 0, p > 2\\ \varphi(m,\varphi(m,n-1,p),p-1) & \text{The general case if none of the above is satisfied}\end{cases}$$

One can check that this agrees with the informal description given above.


In this notation, the Ackermann numbers are defined as the sequence $$ \big(\varphi(n,n,n+1)\big)_{n\in \mathbb{N}} $$ The first few are: $$ \begin{align} \varphi(1,1,2) &= 1^1 = 1 \\ \varphi(2,2,3) &= \varphi(2,2,2) = 2^2 = 4\\ \varphi(3,3,4) &= \varphi(3,\varphi(3,3,3),3)\\ & = \varphi(3,\varphi(3,\varphi(3,3,2),2),3) \\ & = \varphi(3,\varphi(3,27,2),3) \\ & = \varphi(3,3^{27},3) = 3^{3^{3^{\dots^3}}} \end{align}$$ where in the last expression the numeral "$3$" appears a total of $3^{27} \approx 7.6\times 10^{12}$ times.


Many other variants of the Ackermann function have since been defined. For the clarity of discussion, when asking a question about Ackermann functions, please be sure to specify the precise variant used.

63 questions
8
votes
3 answers

Ackermann function - how to calculate the number of times it calls itself

Purely for my own amusement I've been playing around with the Ackermann function. The Ackermann function is a non primitive recursive function defined on non-negative integers by: $A(m,n) = n+1$, if $m=0$ $A(m,n) = A(m-1,1)$, if $m>0$ and…
Moriarty
  • 143
1
vote
1 answer

Explaining the Ackermann function as A: $\mathbb N \times \mathbb N \rightarrow \mathbb N$

We have the following variation of the Ackermann function: $$A(0,m) = m+1$$ $$A(n,0) = \begin{cases}1, & \text{if } n=0 \\ 2, & \text{if } n=1 \\ 0, & \text{if }n=2 \\ 1, & \text{if }n\gt 2\end{cases}$$ $$A(n+1,m+1) = A(n, A(n+1,m))$$ The…
J.R.CD
  • 57
0
votes
1 answer

Is Ackermann's Function Bijective?

I have been trying to understand the more rigorous side of mathematics and especially functions, and I came across Ackermann's Function recently. I was wondering if A(x,y) is bijective among the natural numbers for any pair (x,y). If it isn't, is it…
0
votes
0 answers

Show that the Ackermann function is primitive recursive for every $x \in \mathbb{N}$

Show that for every $x \in \mathbb{N}$ the function $A_x(y) = A(x,y)$ is primitive recursive, with $A(x,y): \mathbb{N} \times \mathbb{N} \to \mathbb{N}$ being the Ackermann function I need some initial advice how to attack this problem. Since the…
kklaw
  • 301
  • 1
  • 9
0
votes
1 answer

Ackerman function

I have a very elementary question: here on the page 7, 4th line why $$ A_{k+1} (n+1) = A_k (A_{k+1} (n))$$ Is it trivial or do we need induction ?
user122424
  • 3,926