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.

58 questions
23
votes
4 answers

Ackermann Function primitive recursive

I am reading the wikipedia page on ackermann's function, http://en.wikipedia.org/wiki/Ackermann_function And I am having trouble understanding WHY ackermann's function is an example of a function which is not primitive recursive. I understand that…
AlanFoster
  • 333
  • 1
  • 2
  • 6
9
votes
2 answers

Ackermann function $A(m, n)$, all nonnegative integer solutions to $A(m, n) = m + n$?

The Ackermann function $A(m, n)$ is given by the recursion$$\begin{cases} A(0, n) \overset{\text{def}}{=} n + 1 \\ A(m + 1, 0) \overset{\text{def}}{=} A(m, 1) \\ A(m + 1, n + 1) \overset{\text{def}}{=} A(m, A(m + 1, n)).\end{cases}$$What are all…
9
votes
2 answers

Example $x$, $y$ and $z$ values for $x\uparrow^\alpha y=z$ where $\alpha\in \Bbb R-\Bbb N$

$\uparrow^n$ and $G(n,\cdot,\cdot)$ are notations for hyperoperation. http://en.m.wikipedia.org/wiki/Hyperoperation $n$ is the hyperoperations rank. Can example $x$, $y$ and $z$ values be provided for either the following formula? The formula can…
alan2here
  • 947
  • 6
  • 23
7
votes
2 answers

Ackermann function and $f_\omega$

The Wikipedia page of Ackermann function states that Ackermann function is "roughly comparable" to $f_\omega$ in fast-growing hierarchy. Is there some standard way to make the "roughly comparable" to more precise form? I would like to understand…
user8523
7
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
  • 133
  • 1
  • 7
5
votes
1 answer

Question about unclear definition of Ackermann-Péter function in Stanford Encyclopedia of Philosophy

I'm reading Recursive Functions at Stanford Encyclopedia of Philosophy (section 1.4). The following paragraph defines function β which is then used to define variant of Ackermann-Péter function: What exactly is the type of Iter? The base case…
5
votes
0 answers

Extending Knuth up-arrow/hyperoperations to non-positive values

So... I had the silly idea to extend Knuth's up-arrow notation so that it included zero and negative arrows. It is normally defined as $$\begin{align*} a \uparrow b & = a^b \\ a \uparrow^n b & = \underbrace{a \uparrow^{n - 1} (a \uparrow^{n - 1}…
theyaoster
  • 1,953
  • 6
  • 16
5
votes
2 answers

Mathematically, how does one find the value of the Ackermann function in terms of n for a given m?

Looking at the Wikipedia page, there's the table of values for small function inputs. I understand how the values are calculated by looking at the table, and how it's easy to see that 5,13,29,61,125 is $2^{n+3}-3$, but how does one go about…
5
votes
1 answer

The Ackermann's function "grows faster" than any primitive recursive function

I am looking at the proof that the Ackermann's function is not primitive recursive. At the part: "We will prove that Ackermann's function is not primitive recursive by showing that it "grows faster" than any primitive recursive function. That…
4
votes
1 answer

Can you define functions which are not primitive recursive, yet total, in Type Theory?

Ackermann's function is total but not primitive recursive. Can one define Ackermann's function in Type Theory, ie: Can you define functions which are not primitive recursive, yet total, in Type Theory? [this post was closed] due to being "not…
4
votes
2 answers

Generalized Recursion vs. Turing Completeness

$\newcommand{\NN}{\mathbb N}\newcommand{\UU}{\mathcal U}$I'm currently reading through Homotopy Type Theory: Univalent Foundations of Mathematics. In Exercise 1.10, we construct the Ackermann function using (their version of) primitive recursion,…
Derive Foiler
  • 687
  • 2
  • 10
4
votes
1 answer

Which is bigger? $Ackermann(G_{64}, G_{64})$ or $G_{G_{64}}$

I have been playing around with the Ackermann function a bit and realized that it gets very big very fast. (Im going to use $A$ for $Ackermann$ throughout this question) Already $A(5,1)$ is (according to WolframAlpha) an integer too large to…
BrainStone
  • 175
  • 1
  • 7
4
votes
1 answer

Ackermann Function - Book recommendation

What books would you recommend me for the topic "Ackermann Function" ?? I will have a presentation at the end of the semester for this topic and I would get some information...
Mary Star
  • 12,214
  • 10
  • 47
  • 149
3
votes
0 answers

Ackermann function is not primitive recursive

The function of the Ackermann function is defined as $$ A_{0}(y)= y+1$$ $$ A_{x+1}(0)= A_{x}(1)$$ $$ A_{x+1}(y +1)= A_{x}(A_{x+1}(y))$$ I want to show that the function of ackermann is primitive recursive, showing that for all function primitive…
Jhon Jairo
  • 1,011
  • 6
  • 14
3
votes
1 answer

Ackermann function in terms of higher order recursion

Wikipedia provides a higher-order definition of Ackermann function. First it gives the normal recursive definition \begin{equation*} A(m,n)=\left\{ \begin{array}{ll} n+1 & \text{if $m=0$} \\ A(m-1,1) & \text{if $m>0$ and $n=0$} \\ A(m-1,A(m,n-1)) &…
user8523
1
2 3 4