In this lab try to implement a few of the classic mathematical functions that are expressed as recurrence relations.
You will need to write some code to call each of your methods and print its result.
|Fibonacci||Fibonacci really should not be implemented using recursion. Test with small numbers!|
|Euclid’s GCD||This is the ancient version.|
|Euclid’s GCD||This is the faster modern version that uses the modulus (
|Squaring without multiplication||
|Mutually recursive odd & even||
|Combinations — n choose k||There are are several different recursive definitions in the Wikipedia page for combinations. The Math is Fun page for Pascal’s triangle also presents these ideas with some very nice illustrations.|
|Ackermann function||This function is renown for how fast it grows. You must run it with small number.|