What Recursion is This?

T ( n ) = 16 T ( n 4 ) + log 2 ( n ) \large T(n) = 16T(\lfloor \sqrt[4]{n} \rfloor) + \log ^{2} (n)

Upon analyzing a function's time complexity, the above relation came up. Then what does T ( n ) T(n) belong to?

Notations: O , \mathcal{O}, o o , Ω \Omega , ω \omega and Θ \Theta are standard Landau notations .

ω ( n ) \omega(n) Θ ( n log ( n ) ) \Theta(n\log(n)) O ( log 2 ( n ) log ( log ( log ( n ) ) ) ) \mathcal{O}(\log^{2}(n)\log(\log(\log(n)))) o ( n 4 log 4 ( n ) ) \mathcal{o}(n^{4}\log^4(n)) Ω ( n 2 log 3 ( n ) ) \Omega(n^{2}\log^{3}(n))

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

3 solutions

Kunal Gupta
Sep 20, 2017

At first , the recurrence might be a bit overwhelming, but if we look at it by changing variables, we can see more easily! So let m = log ( n ) m = \log(n) . So that the recurrence becomes: T ( 2 m ) = 16 T ( 2 m 4 ) + m 2 T(2^{m}) = 16T(\lfloor 2^{\frac{m}{4}} \rfloor)+ m^{2} Now, let another recurrence variate R ( m ) = T ( 2 m ) R(m) = T(2^m) . So that we have , R ( m ) = 16 R ( m 4 ) + m 2 R(m) = 16R(\dfrac{m}{4})+m^{2} Now, we'll apply Master Theorem to solve this recurrence. We have, R ( m ) = Θ ( m 2 log ( log ( m ) ) ) R(m) = \Theta (m^{2}\log(\log(m))) Plugging m = log ( n ) m = \log (n) we get: T ( n ) = Θ ( log 2 ( n ) log ( log ( log ( n ) ) ) ) T(n) = \Theta(\log^{2}(n)\log(\log(\log(n)))) As, Θ ( n ) = O ( n ) \Theta(n) = \mathcal{O}(n) So, T ( n ) O ( log 2 ( n ) log ( log ( log ( n ) ) ) ) T(n) \in \mathcal{O}(\log^{2}(n)\log(\log(\log(n))))

You use wrong notation for log(logn) , means (logn) power2 is different from log(logn).

ISHAN TYAGI - 3 years, 6 months ago

Log in to reply

Hey, in my opinion everything is correct. log 2 ( n ) = ( log ( n ) ) 2 \log^{2}(n) = (\log(n))^{2}

Kunal Gupta - 3 years, 6 months ago

Won't Master theorem give (m^2)logm as the answer to the new recurrence

NILAY PANDE - 3 years, 6 months ago

Log in to reply

No, check your working again, the answer given is correct

Kunal Gupta - 3 years, 6 months ago
Vikas Venkatraman
Nov 24, 2017

use recurrence tree to solve the problem... when you sketch the recurrence tree for the above problem,you will find that, at every stage log^2(n) work is been done and the height of the recurrence tree is log(log(log(n))). so T(n)=O( log^2(n)log(log(log(n)))) is the correct answer.

Hasmik Garyaka
Sep 20, 2017

I don't know what mean m a t h c a l O mathcal{O} but other choices are wrong and I did as Sherlock Holmes.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...