Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The Fibonacci numbers are defined by the recurrence if n= if n 1 rt n-1 + F-2, if n > 2 Show that Fn 22/2,

image text in transcribed

The Fibonacci numbers are defined by the recurrence if n= if n 1 rt n-1 + F-2, if n > 2 Show that Fn 22"/2, n26. (b) Assume that the cost of adding, subtracting, or multiplying two integers is O(1), inde- pendent of the size of the integers. rite pseudocode for an algorithm that computes Fn based on the recur sive definition above. Develop a recurrence for the running time of your algorithm and give an asymptotic lower bound for it. rite pseudocode for a non-recursive algorithm that asymptotically per forms fewer additions than the recursive algorithm. Discuss the running time of the new algorithm Show how to compute Fn in O(log n) time using only integer additions and multiplications (Hint: Express Fn in matrix notation and consider the matrix and its powers. Now assume that adding two m-bit integers requires ?(m) time and that multiplying two m-bit integers requires ?(m2) time. What is the running time of the three algorithms under this more reasonable cost measure for the elementary arithmetic operations? The Fibonacci numbers are defined by the recurrence if n= if n 1 rt n-1 + F-2, if n > 2 Show that Fn 22"/2, n26. (b) Assume that the cost of adding, subtracting, or multiplying two integers is O(1), inde- pendent of the size of the integers. rite pseudocode for an algorithm that computes Fn based on the recur sive definition above. Develop a recurrence for the running time of your algorithm and give an asymptotic lower bound for it. rite pseudocode for a non-recursive algorithm that asymptotically per forms fewer additions than the recursive algorithm. Discuss the running time of the new algorithm Show how to compute Fn in O(log n) time using only integer additions and multiplications (Hint: Express Fn in matrix notation and consider the matrix and its powers. Now assume that adding two m-bit integers requires ?(m) time and that multiplying two m-bit integers requires ?(m2) time. What is the running time of the three algorithms under this more reasonable cost measure for the elementary arithmetic operations

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

Readings In Database Systems

Authors: Michael Stonebraker

2nd Edition

0934613656, 9780934613651

More Books

Students also viewed these Databases questions

Question

How is slaked lime powder prepared ?

Answered: 1 week ago

Question

Why does electric current flow through acid?

Answered: 1 week ago

Question

What is Taxonomy ?

Answered: 1 week ago

Question

1. In taxonomy which are the factors to be studied ?

Answered: 1 week ago

Question

1.what is the significance of Taxonomy ?

Answered: 1 week ago