Question: This final problem is similar to Exercise 6 on (p.83), at the end of Section 2.5. First take a look the statement and solution for

 This final problem is similar to Exercise 6 on (p.83), at

This final problem is similar to Exercise 6 on (p.83), at the end of Section 2.5. First take a look the statement and solution for this problem: 6. The maximum values of the Java primitive types int and long are 2311 and 2631, respectively. Find the smallest n for which the nth Fibonacci number is not going to fit in a memory allocated for a. the type int. b. the type long. Solution of the text problem: a. The question is to find the smallest value of n such that F(n)>2311. Using the formula F(n)=51n rounded to the nearest integer, we get (approximately) the following inequality: 51n>2311orn>5(2311). After taking natural logarithms of both hand sides, we obtain n>lnln(5(2311))46.3. Thus, the answer is n=47. b. Similarly, we have to find the smallest value of n such that F(n)> 2631. Thus, 51n>2631,orn>5(2631) or, after taking natural logarithms of both hand sides, n>lnln(5(2631))92.4. Thus, the answer is n=93

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