Take the 2-minute tour ×
Computer Science Stack Exchange is a question and answer site for students, researchers and practitioners of computer science. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

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, ... 
share|improve this answer
4  
Although those links are unlikely to break, would you quote the most relevant part of those links? –  Merbs Nov 21 '12 at 21:01
    
Thanks for your help. –  bot_bot Nov 23 '12 at 9:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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