Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Time Complexity of ackermann function

Does anybody know the time complexity to compute the ackermann function ack(m,n) in big-O notation or to which complexity class it belongs? Just Ack(3, n) would be also sufficient. I read somewhere it is NONELEMENTARY?

Thanks.

Code Snippet:

public class Ackermann {

    public static int ackermann(int n, int m) {

        if (n == 0)
            return m + 1;
        else if (m == 0)
            return ackermann(n - 1, 1);
        else
            return ackermann(n - 1, ackermann(n, m - 1));
    }

}
like image 598
Thorben Avatar asked Jun 28 '13 14:06

Thorben


People also ask

Is the Ackermann function computable?

The Ackermann function is the simplest example of a well-defined total function which is computable but not primitive recursive, providing a counterexample to the belief in the early 1900s that every computable function was also primitive recursive (Dötzel 1991).

Where α N is the inverse Ackermann function?

The inverse Ackermann function α(n) assigns to each integer n the smallest k for which α k(n) ≤ 3: α(n) = min { k : α k(n) ≤ 3 }. Thus, α(9876!) = 5.

Is Ackermann function primitive recursive?

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.

How do we define the Ackermann's function?

(algorithm) Definition: A function of two parameters whose value grows very fast. Formal Definition: A(0, j)=j+1 for j ≥ 0.


2 Answers

Asymptotic limits of worst case computation time expressed as the function of input length or the time complexity : Can not be defined for mu recursive functions, not atlest without referring to another mu recursive function very different from the typical big oh notation. And this only for those mu recursive functions which are 'total' like our subject.

like image 140
ARi Avatar answered Sep 17 '22 22:09

ARi


I don't know too much about this function, but quickly looking at it, it seems to be pseudo-polynomial. That is, the runtime depends on it's input and can be polynomial-time on certain inputs while non-polynomial on others. This could be proven using Cantor's Diagonalization

like image 24
Chevy787 Avatar answered Sep 21 '22 22:09

Chevy787