retagged by
1,356 views
0 votes
0 votes
find T(n) = T(n-1)*T(n-2), given T(1) = a and T(2) = b
retagged by

1 Answer

3 votes
3 votes

NOTE 

1,1,2,3,5,..........  is a fibonacci series.

Name the above fibonacci series as fibonacci 1. 

Let us assume the nth term of fibonacci 1 be fn

then fn = 1/√5 ( ( (1+√5)/2 )n   -   ( ( 1-√5)/2 )n ) (Consider this as a fact)

Now, come to our problem

Let us assume T(n) = akn bm........................................................... (1)

then T(n+1) = akn+1 bmn+1...............................................(2)

Now, it is given in the question that T(n+2) = T(n) * T(n+1) 

=> T(n+2) = akn bmn * akn+1 bmn+1   from equations 1 & 2

=> T (n+2) = a(kn + kn+1)  b(mn + mn+1)

So, we are seeing that the power of 'a' in T(n+2) = summation of the powers of 'a' in T(n) and T(n+1)

Now, T (n+2) = akn+2  bmn+2 

So, we get kn+2 = kn +kn+1

Thus the powers of 'a' forms a fibonacci series.

Similarly we can say it for the powers of 'b'

here mn+2 = mn +mn+1

Now, T(1) = a  so, k1 = 1 and m1 = 0

 Again T(2) = b so, k2 = 0 and m2 = 1

Thus the powers of 'a' forms the fibonacci series 1,0,1,1,2,......

name the above fibonacci series as fibonacci 2

If we look at the series fibonacci 1 and fibonacci 2 carefully we get that the nth term of fibonacci 2 is equal to (n-2)th term of fibonacci 1 for n>=3.

So, the terms of fibonacci 2 are

k1 = 1  k2 = 0 and kn = fn-2 for n>=3.

Similarly we get that the powers of 'b' forms the fibonacci series 0,1,1,2,.... name this series as Fibonacci 3

We get that nth term of fibonacci 3 is equal to (n-1)th term of Fibonacci 1 

so, the terms of Fibonacci 3 are

m1 = 0, m2=1 , mn = fn-1 for n>=3

So, our required solution T(n) = akn bmn = afn-2bfn-1 for n>=3.

edited by

Related questions

1 votes
1 votes
1 answer
2
lalitver10 asked Jan 4, 2022
609 views
T(n)=T(n/5)+T(7n/10)+ana: constantwhat will be the time complexity of the above recurrence relation??Please share the approach for this kind of recurrence relation
0 votes
0 votes
3 answers
3
aditi19 asked Oct 6, 2018
1,143 views
what is the recurrence relation for merge sort?
0 votes
0 votes
1 answer
4
Sambhrant Maurya asked Aug 7, 2018
401 views
If k is a positive constant, then the following divide and conquer recurrence evaluates to?T(n) = k ; n=1T(n) = 3 T (n/2) + kn ;n>1a)T(n)= 3kn2-knb)T(n)=3kn log23 - 2knc...