Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
This final problem is similar to Exercise 6 on (p.83), at the end of Section 2.5. First take a look at 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. Now solve this problem not from text: We are using a supercomputer in which integers are represented on 128 bits. What is the largest n for which the Fibonacci number F(n) does fit in the memory allocated? - Note well: The text problem is asking for the first number that does not fit. This problem is asking for the last number that does fit

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems 22nd European Conference Adbis 2018 Budapest Hungary September 2 5 2018 Proceedings Lncs 11019

Authors: Andras Benczur ,Bernhard Thalheim ,Tomas Horvath

1st Edition

3319983970, 978-3319983974

Students also viewed these Databases questions

Question

c. What groups were least represented? Why do you think this is so?

Answered: 1 week ago

Question

7. Describe phases of multicultural identity development.

Answered: 1 week ago