Ackermann’s function

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.

The Ackermann function, due to its definition in terms of extremely deep recursion, can be used as a benchmark of a compiler’s ability to optimize recursion.

Read more on WikiPedia

The following code demonstrates¬†Ackermann’s function in a recursive way

Please use the above code as a concept only to understand¬†Ackermann’s function. There are more optimal ways to compute the function. See below:

Author: Victor Fernandes

A friend I really respect once told me, unless you are able to dumb down a concept for someone who has no prior information about it, you can't be sure you know it yourself. I try to create blog posts that are extremely easy to understand most suitable for those in a hurry. The topics I write about include web development, digital marketing and software in general.

 
Notice an error in any content or would like to get something removed? Please inform Victor here.

Leave a Reply

Your email address will not be published. Required fields are marked *