Chapter 1: Q19E (page 49)
The Fibonacci numbers are given by the recurrence. Show that for any.
Short Answer
For any ,
Chapter 1: Q19E (page 49)
The Fibonacci numbers are given by the recurrence. Show that for any.
For any ,
All the tools & learning materials you need for study success - in one app.
Get started for freeThe grade-school algorithm for multiplying two n-bit binary numbers x and y consist of addingtogethern copies of r, each appropriately left-shifted. Each copy, when shifted, is at most 2n bits long.
In this problem, we will examine a scheme for adding n binary numbers, each m bits long, using a circuit or a parallel architecture. The main parameter of interest in this question is therefore the depth of the circuit or the longest path from the input to the output of the circuit. This determines the total time taken for computing the function.
To add two m-bit binary numbers naively, we must wait for the carry bit from position i-1before we can figure out the ith bit of the answer. This leads to a circuit of depth. However, carry-lookahead circuits (seewikipedia.comif you want to know more about this) can add indepth.
Consider the problem of computing .
(a) If is an role="math" localid="1658397956489" -bit number, how many bits long is , approximately ( form)?
(b) Give an algorithm to compute and analyze its running time.
Show that
(Hint: To show an upper bound, compare with . To show a lower bound, compare it with ).
What is ?
Suppose you want to compute the nth Fibonacci number , modulo an integer . Can you find an efficient way to do this?
What do you think about this solution?
We value your feedback to improve our textbook solutions.