Study the program to generate the Fibonacci sequence.
> nums := [seq(i,i=1..20)];
> fibnums := map(fibonacci, nums);
> plot( zip( (x,y)->[x,y], nums, fibnums) );
taken from http://www.maths.uq.edu.au/~mrb/tutors/mapleprog.html .
Do the following exercise listed there:
- Write a function M-file in Matlab (and include this with your homework)
which works out Fibonacci numbers using the recursive definition we
used in Maple.
- The recursive definition is elegant but hopelessly inefficient - even
finding the 25th number takes a long time. Write a faster Fibonacci function in Maple,
similar to fact1. You should be able to find the 2000th Fibonacci number in a second.
- Use
?stats[fit] to learn about Maple's fitting abilities. With your larger
Fibonacci numbers, fit a straight line to the logarithms and find an
approximate formula for the nth number. Compare your formula with some further values,
such as the 10000th number.