edited by
744 views

4 Answers

1 votes
1 votes

$T(n)=7T\left ( \frac{n}{3} \right )\dotplus n^{2}$

Given recurrence relation is in this below form.

$T(n)=aT\left ( \frac{n}{b} \right )\dotplus n^{c}$

Solving this recurrence relation we get,

$T(n)=n^{c}\sum_{k=0}^{log_{b}n-1} \left ( \frac{a}{b^{c}} \right )^{k}\dotplus n^{log_{b}a}$

And geometric sum,

$\sum_{k=0}^{n}x^{n}= \frac{x^{n+1}-1}{x-1}=\Theta \left ( x^{n} \right )$

Now after solving  the given relation we get

$T(n)=n^{2}\sum_{k=0}^{log_{3}n-1} \left ( \frac{7}{3^{2}} \right )^{k}\dotplus n^{log_{3}7}$

And the sum of decreasing  geometric term $\sum_{k=0}^{log_{3}n-1} \left ( \frac{7}{3^{2}} \right )^{k}$ will be constant.

So $T(n)=n^{2}\dotplus n^{log_{3}7}$

$T(n)=O\left ( n^{2} \right )$

edited by
0 votes
0 votes

by expanding function:-

T(n) = 7T(n/3) + n2    

         = 7(7T(n/32) +(n/3)2)+n2

         = 7kT(n/3k) +(n/3k-1)2 +.......n2      n/3k =1  =>  log3 n = k

T(n) = n2 [7/9 + (7/9)2 + (7/9)3 ...........(7/9)k ]

T(n) = n2 [7/9 + (7/9)2 + (7/9)3 ...........(7/9)(log3 n) -1 + (7/9)log3 n ]

T(n) = n2(7/9 - (7/9)(log3 7/9) +1)/(1 - 7/9)        (7/9<1)

Related questions

4 votes
4 votes
0 answers
3