Ackermanns function, named after the German mathematician Wilhelm Ackermann, is used in the theory of recursive functions.

Question:

Ackermann’s function, named after the German mathematician Wilhelm Ackermann, is used in the theory of recursive functions. There are several variants of this function. Their common properties are that the function takes two parameters (x and y) and grows very fast (much faster than polynomials or exponentials). Here is one variant:

1. If x = 0, then Ackermann(x, y) = 2y.
2. If x >= 1 and y = 0, then Ackermann(x, y) = 0.
3. If x >= 1 and y = 1, then Ackermann(x, y) = 2.
4. If x >= 1 and y >= 2, then Ackermann(x, y) =
Ackermann(x–1, Ackermann(x, y–1)).

Implement this variant of Ackermann’s function with a recursive method.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: