Question: The Ackermann function takes two integer arguments m and n, and is defined as follows for initial m and n both greater than 0: if

The Ackermann function takes two integer arguments m and n, and is defined as follows for initial m and n both greater than 0:

if m = 0 then Ackermann equals n + 1

if n = 0 then Ackermann equals Ackermann(m 1, 1)

if neither m nor n is 0, then Ackermann equals Ackermann (m 1, Ackermann(m, n 1))

The Ackermann function grows amazingly fast, and takes a very large number of calls to be evaluated. For instance, evaluation of Ackermann(3, 4) requires over 10, 000 calls.

Implement this function and test it out for values of m and n. At what values of m and n does it take more than a million calls to evaluate this function?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!