Question: 2. Using your favorite programing language (Matlab, Python, C, C++,...) compute the first 1000 elements of the Fibonacci sequence f(n) = f(n-1)+f(n-2) where f(1) =

 2. Using your favorite programing language (Matlab, Python, C, C++,...) compute

2. Using your favorite programing language (Matlab, Python, C, C++,...) compute the first 1000 elements of the Fibonacci sequence f(n) = f(n-1)+f(n-2) where f(1) = f(2) = 1. Determine the first digit of each element. Find the histogram of the first digit. That is, find the fraction p(k) of the first digits that are k = 1, 2, ..., 9. Hint: In Matlab the function "hist" could be useful. Compare with log1((k + 1)/k), for k = 1, ...,9. You should produce a table like below. K p(k) log10 ((k + 1)/ k) 1 2 3 6 -J OO 9

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 Mathematics Questions!