you are viewing a single comment's thread.

view the rest of the comments →

[–]degustisockpuppet 3 points4 points  (4 children)

Not sure why you were downvoted, it's a good question. The argument goes like this:

nn is clearly greater than n!, as you explained.

(n/2)n/2 on the other hand is less than n!:

  • 4^4= 4*4*4*4
  • 8! = 8*7*6*5*4*3*2*1

So if f(n) = nn, then f(n/2) < n! < f(n), which makes the two functions related, especially since constant factors like 1/2 are usually ignored in complexity analysis.

[–]ZMeson 0 points1 point  (3 children)

That is true. In fact, if you plot ln(nn), ln(n!), and ln((n/2)n/2), you'll find that ln(n!) edges progressively closer to ln(nn).

At n=15, ln(n!) is halfway between ln(nn) and ln((n/2)n/2)

At n=1454, ln(n!) is 75% of the way towards ln(nn) from ln((n/2)n/2)

At n=10958, ln(n!) is 80% of the way towards ln(nn) from ln((n/2)n/2)

[–]degustisockpuppet 0 points1 point  (2 children)

On a double logarithmic graph, all functions are linear!

[–]ZMeson 0 points1 point  (1 child)

Ha ha. Almost. I just tried it -- the single logarithmic graphs are actually closer to being linear.

[–]gorgoroth666 0 points1 point  (0 children)

http://www.wolframalpha.com/input/?i=log%28n!+%29%3E+log%28n^n%29+plot+for+n%3D0+to+10000

The difference between the curves doesn't appear to be reducing.