On 4 Feb, 04:19,
fromth...@hotmail.com wrote:
> I'm n ot s ure it ma kes sense to add big O's directly (does it?).
> Did you mea n...
>
> O(s um(r=2 to sqrt(n)) of (l og(n/r)))
Ah very good question! That's why i am asking you guys ;-)
Let me express and refine "in words" what i intended to mean here: so
you can suggest the rigorous math formulation.
I simply mean that complexity of the problem can be reduced to a loop,
for r = 2 to sqrt(n), of "subproblems".
Each subproblem (within this loop) has, in turn, a complexity that is
the logarithm of a quantity which
decreases, with hyperbolic rate, from ( n/2 - sqrt(n) + 1 ) to 2, in
( sqrt(n) - 1 ) equidistant steps, 2 ... sqrt(n).
My intuitive guess was here that the overally complexity might be
bounded by O(sqrt(n)).
Of course, if it turned out that the iperbolic decrease rate is enough
to arrive at O(n*(ln(n))^k), or better O((log(n))^k), it would be
good.
>
> ...?
>
> (RIGHT?)
>
> Here are a few more hints:
>
> > log(n/r) can be simplified to log(n) - log(r)
> > a series of the form sum(for n = 1 to k) simplifies to n(n+1)/2
> > with big O notation, you are allowed to drop constants (as you
> probably already know)
Yep. I know that the sum of logs is a log of a product. What i wanted
to see is actually
how to frame better and set up formally the general computation.
-P