ArticleslgStudy

mathematics

Ackermann function

Ackermann function is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Ackermann function rather than just read about it. In short: In computability theory, the Ackermann function, named after Wilhelm Ackermann, is one of the simplest and earliest-discovered examples of a total computable function that is not primitive recursive. All primitive recursive functions are total and computable, but the Ackermann function illustrates that not all total computable functions are primitive recursive.

Key takeaways

  • Ackermann function belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Ackermann function to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Ackermann function from memory before moving on to harder problems.

Reference excerpt

In computability theory, the Ackermann function, named after Wilhelm Ackermann, is one of the simplest and earliest-discovered examples of a total computable function that is not primitive recursive. All primitive recursive functions are total and computable, but the Ackermann function illustrates that not all total computable functions are primitive recursive. It is essentially constructed by diagonalizing a sequence of primitive recursive functions f1,f2,… selected from the Grzegorczyk hierarchy. This makes the Ackermann function the first limit point fω of the fast-growing hierarchy. After Ackermann's publication of his function (which had three non-negative integer arguments), many authors modified it to suit various purposes, so that today "the Ackermann function" may refer to any of numerous variants of the original function. One common version is the two-argument Ackermann–Péter function developed by Rózsa Péter and Raphael Robinson. This function is defined from the recurrence relation A⁡(m+1,n+1)=A⁡(m,A⁡(m+1,n)) with appropriate base cases. Its value grows very rapidly; for example, A⁡(4,2) results in 265536−3, an integer with 19,729 decimal digits.

History In the late 1920s, the mathematicians Gabriel Sudan and Wilhelm Ackermann, students of David Hilbert, were studying the foundations of computation. Both Sudan and Ackermann are credited with discovering total computable functions (termed simply "recursive" in some references) that are not primitive recursive. Sudan published the lesser-known Sudan function, then shortly afterwards and independently, in 1928, Ackermann published his function φ (from Greek, the letter phi). Ackermann's three-argument function, φ(m,n,p), is defined such that for p=0,1,2, it reproduces the basic operations of addition, multiplication, and exponentiation as φ(m,n,0)=m+nφ(m,n,1)=m×nφ(m,n,2)=mn and for p>2 it extends these basic operations in a way that can be compared to the hyperoperations: φ(m,n,3)=m[4](n+1)φ(m,n,p)⪆m[p+1](n+1)for p>3 (Aside from its historic role as a total-computable-but-not-primitive-recursive function, Ackermann's original function is seen to extend the basic arithmetic operations beyond exponentiation, although not as seamlessly as do variants of Ackermann's function that are specifically designed for that purpose—such as Goodstein's hyperoperation sequence.) In On the Infinite, David Hilbert first hypothesized that the Ackermann function was not primitive recursive, but it was Ackermann, Hilbert's personal secretary and former student, who actually proved the hypothesis in his paper On Hilbert's Construction of the Real Numbers. Rózsa Péter and Raphael Robinson later developed a two-variable version of the Ackermann function that became preferred by almost all authors. The generalized hyperoperation sequence, e.g. G(m,a,b)=a[m]b, is a version of the Ackermann function as well. In 1963 R. Creighton Buck based an intuitive two-variable variant F on the hyperoperation sequence: F⁡(m,n)=2[m]n. Compared to most other versions, Buck's function has no unessential offsets: F⁡(0,n)=2[0]n=n+1F⁡(1,n)=2[1]n=2+nF⁡(2,n)=2[2]n=2×nF⁡(3,n)=2[3]n=2nF⁡(4,n)=2[4]n=222...2⋮ Many other versions of Ackermann function have been investigated.

Definition

Definition: as m-ary function Ackermann's original three-argument function φ(m,n,p) is defined recursively as follows for nonnegative integers m,n, and p: φ(m,n,0)=m+nφ(m,0,1)=0φ(m,0,2)=1φ(m,0,p)=mfor p>2φ(m,n,p)=φ(m,φ(m,n−1,p),p−1)for n,p>0 Of the various two-argument versions, the one developed by Péter and Robinson (called "the" Ackermann function by most authors) is defined for nonnegative integers m and n as follows: A⁡(0,n)=n+1A⁡(m+1,0)=A⁡(m,1)A⁡(m+1,n+1)=A⁡(m,A⁡(m+1,n)) The Ackermann function has also been expressed in relation to the hyperoperation sequence: A(m,n)={n+1m=02[m](n+3)−3m>0 or, written in Knuth's up-arrow notation (extended to integer indices ≥−2): A(m,n)={n+1m=02↑m−2(n+3)−3m>0 or, equivalently, in terms of Buck's function F: A(m,n)={n+1m=0F(m,n+3)−3m>0 By induction on m, one can show that F(m,n)≤A(m,n) for all m,n∈ℕ0.

Definition: as iterated 1-ary function Define fn as the n-th iterate of f: f0(x)=xfn+1(x)=f(fn(x)) Iteration is the process of composing a function with itself a certain number of times. Function composition is an associative operation, so f(fn(x))=fn(f(x)). Conceiving the Ackermann function as a sequence of unary functions, one can set Am(n)=A⁡(m,n). The function then becomes a sequence A0,A1,A2,... of unary functions, defined from iteration: A0(n)=n+1Am+1(n)=Amn+1(1).

Computation

Computation by LOOP program The functions Ai fit into the (finite-level) fast-growing hierarchy (FGH) of functions

FGH0(n)=n+1FGHm+1(n)=FGHmn(n). The following inequality holds: ∀m>1,∀n>1:Am(n)<FGHm(n) For fixed k, the function FGHk(n) can be computed by a LOOP program of nesting depth k:

The function Ak(n) can also be computed by a LOOP-k program. (The program (schema) is not listed here.) It is obvious that A⁡(m,n), not being a primitive recursive function —see below—, cannot be computed by a LOOP program.

Computation by term rewriting system, based on 2-ary function The recursive definition of the Ackermann function can naturally be transposed to a term rewriting system (TRS). The definition of the 2-ary Ackermann function leads to the obvious reduction rules (r1)A(0,n)→S(n)(r2)A(S(m),0)→A(m,S(0))(r3)A(S(m),S(n))→A(m,A(S(m),n)) Example Compute A(1,2)→∗4 The reduction sequence is

To compute A⁡(m,n) one can use a stack, which initially contains the elements ⟨m,n⟩. Then repeatedly the two top elements are replaced according to the rules (r1)0,n→(n+1)(r2)(m+1),0→m,1(r3)(m+1),(n+1)→m,(m+1),n Schematically, starting from ⟨m,n⟩:

WHILE stackLength <> 1 { POP 2 elements; PUSH 1 or 2 or 3 elements, applying the rules r1, r2, r3 }

The pseudocode is published in Grossman & Zeitman (1988). For example, on input ⟨2,1⟩,

Remarks

The leftmost-innermost strategy is implemented in 225 computer languages on Rosetta Code. For all m,n the computation of A(m,n) takes no more than (A(m,n)+1)m steps. Grossman & Zeitman (1988) pointed out that in the computation of A⁡(m,n) the maximum length of the stack is A⁡(m,n), as long as m>0. Their own algorithm, inherently iterative, computes A⁡(m,n) within 𝒪(mA⁡(m,n)) time and within 𝒪(m) space.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Ackermann function

Start with the simplest possible case. Write down what Ackermann function claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Ackermann function before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Ackermann function ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Ackermann function

In research
Ackermann function appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Ackermann function in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Ackermann function is common in secondary-school and first-year university syllabi. It links to neighbouring topics Arithmetic, Computability theory, Large integers, so understanding it makes those chapters shorter.
In everyday life
Look for Ackermann function outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Ackermann function” →

How to study Ackermann function in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Ackermann function means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Ackermann function out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Ackermann function in simple terms?

In computability theory, the Ackermann function, named after Wilhelm Ackermann, is one of the simplest and earliest-discovered examples of a total computable function that is not primitive recursive. All primitive recursive functions are total and computable, but the Ackermann function illustrates…

Why does Ackermann function matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Ackermann function?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Ackermann function.

Tags

  • Arithmetic
  • Computability theory
  • Large integers
  • Special functions
  • Theory of computation

Keep exploring