4
$\begingroup$

We covered this in class today. I understand the mechanics of it, but aside from being a nice example of recursion does it serve any purpose?

enter image description here

Searching the web reveals lots of pages with the formula and it's implementation in code, some talk about the author, but nothing about it's purpose.

$\endgroup$
3
$\begingroup$

You might use it to evaluate the performance of programming languages:

http://en.wikipedia.org/wiki/Tak_%28function%29

since recursive methods are pretty useful for benchmarking. In particular, deep recursion tests the speed with which a language can make method calls. This is important because modern applications have a tendency to spend much of their time calling various API functions.

You will also need it to solve ballot problems like this one:

Suppose A and B are candidates for office and there are 2n voters, n
voting for A and n for B. In how many ways can the ballots be counted
so that B is never ahead of A?

http://mathworld.wolfram.com/BallotProblem.html

or just to generate Takeuchi Numbers:

0, 1, 4, 14, 53, 223, 1034, 5221, 28437, ... 
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.