Programming

Ackermann’s function

By October 7, 2017 July 21st, 2019 No Comments

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 computer’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:

Victor Fernandes

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.

Leave a Reply

Contact Me

If you prefer email, you may also email me at [email protected]