3. The Fibonacci numbers F n (nN) are defined by F 1 def 1. F 2 def...
Question:
3. The Fibonacci numbers Fn (n∈N) are defined by F1 def 1.
F2 def 1.
Fn+2 def Fn+1 + Fn
for all n ∈ N.
(a) Compute F7.
(b) Prove: If a > b ≥ 0 are integers such that the program Euclid
(a,
b) makes k ∈ N recursive calls, then a ≥ Fk+2 and b ≥ Fk+1 hold. (Hint: Use mathematical induction on k.)
(c) Prove: The program Euclid(F[k+1], F[k]) makes exactly k - 1 recursive calls for all k ∈ N. (Hint: Use mathematical induction on k and the recursive definition of the Fibonacci numbers F[k].) Use part
(b) to conclude that consecutive Fibonacci numbers are a worst-case input for Euclid's algorithm with respect to the number of recursive calls.
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Secure Communicating Systems Design Analysis And Implementation
ISBN: 9780521807319
1st Edition
Authors: Michael R. A. Huth
Question Posted: