0

For recursive implementation of Fibonacci series, the recursive equation is given by:-

T(n) = T(n-1) + T(n-2) + c

My question is that why do we have to assume that upper bound of T(n-2) has to be T(n-1) and similarly why lower bound of T(n-1) has to be equal to T(n-2)?

Suppose some recursive equation is given as:-

T(n) = T(n-2) + T(n-3) + T(n-5) + c

then would we be assuming here also that upper bound of T(n-2) and T(n-3) will be equal to T(n-5) and lower bound of T(n-3) and T(n-5) will be equal to T(n-2) ,i.e.,

For approximating upper bound, T(n) = 3T(n-5) + c

and for approximating lower bound, T(n) = 3T(n-2) + c

in order to solve for T(n) ?

zester
  • 165
  • 3
  • 12
  • The recurrence is strictly decreasing to its a given that T(n - 1) >= T(n - 2) – Mitch May 23 '20 at 00:41
  • It's not clear what you mean. In what sense do we assume the upper bound of T(n-2) has to be T(n-1) and so on? The equation T(n) = T(n-1) + T(n-2) + c does not include any upper bounds. – Paul Hankin May 23 '20 at 07:48
  • You can't in general assume that T is increasing, so any assumption that it is needs to be justified. For fibonacci it's clear, since part of computing fib(n+1) (using the obvious recursive code) involves computing fib(n), so must take longer. – Paul Hankin May 23 '20 at 07:51
  • The runtime of the collatz function is one that is not a decreasing function. – Paul Hankin May 23 '20 at 07:54

0 Answers0