0

How to find T(n)=Θ(f(n)) for the recurrence T(n) = T(logn)+log(log(n))?

I think T(n)= Θ(log(n)) but the proof is the hard part for me. I'm going to attempt to prove by substitution but please help me with that. I also tried a proof by induction but that got out of hand quickly...

Assume T(n) = logn such that

proof of big o:

T(n+1) = T(log(n+1))+loglog(n+1)
       = loglog(n+1) + loglog(n+1) < c*log(n) (check)

proof of big ohmega:

T(n-1) = T(log(n-1))+loglog(n-1)
       = loglog(n-1) + loglog(n-1) > c*log(n) (not good)

Thoughts on proving this via sub. or via induction? ... wish I could just plug and chug into master theorem ~

Sudocode
  • 69
  • 2
  • 10

1 Answers1

3

Direct approach seems the best fit.

T (n) = log log n + T (log n) =
        log log n + log log log n + T (log log n) =
        log log n + log log log n + log log log log n + T (log log log n) =
        log log n + log log log n + log log log log n + log log log log log n + ...

The first term is log log n, and every term dominates the next one.
So the function is Omega (log log n).

Gassa
  • 8,546
  • 3
  • 29
  • 49
  • Oh snap good point! okay so then by sub. we can say c*logloglogn + loglogn >= c*loglogn for the upperbound (are we sure here) b/c in the lower bound we would get it to work as c*logloglogn + loglogn <= c*loglogn (check) – Sudocode Feb 15 '18 at 08:32
  • Perhaps `0 <= log f (x) <= 0.5 f (x)` will help in formally showing that the first term directly dominates the whole series. – Gassa Feb 15 '18 at 08:51
  • 1
    Ok I guess I'll keep digging but thanks for the correction of logn -> loglogn, I definitely agree! – Sudocode Feb 15 '18 at 09:13