-6

How do I find the answer for: n! = Θ( )? Even Big O is enough. All clues I found are complex math ideas.

What would be the correct approach to tackle this problem? recursion tree seems too much of a work

the goal is to compare between n! and n^logn

Cœur
  • 32,421
  • 21
  • 173
  • 232
Alex
  • 87
  • 2
  • 8
  • 2
    Huh? `n! = Θ(n!)`. Are you looking for some other way to say "n!"? – Sneftel Mar 25 '14 at 17:45
  • Is `O(n!)` a bad answer? Also you cannot really say that a function is equal to `O` because `O` denotes a class of functions and such equality is nonsensical. It makes more sense to say belongs to. – luk32 Mar 25 '14 at 17:45
  • @luk32 "=" is very commonly used here. As per [Wikipedia](http://en.wikipedia.org/wiki/Big_O_notation) - "Note that "=" is not meant to express "is equal to" in its normal mathematical sense, but rather a more colloquial "is"". – Bernhard Barker Mar 25 '14 at 17:48
  • how is n! comparing to n^logn – Alex Mar 25 '14 at 17:50
  • @Dukeling OK. I just checked that, I give that it is controversial =). Even the mentioned wikipedia says people call it abuse of notation. They actually gave the same reasoning as I did. BTW I also don't like the `f = O()` notation because it gives the notion that you can compute it. While with `O` notations you can only compare things. – luk32 Mar 25 '14 at 17:50

2 Answers2

3

Θ(n!) is a perfectly fine, valid complexity, so n! = Θ(n!).

As Niklas pointed out, this is actually true for every function, although, for something like
6x² + 15x + 2, you could write Θ(6x² + 15x + 2), but it would generally be preferred to simply write Θ(x²) instead.


If you want to compare two functions, simply plotting it on WolframAlpha might be considered sufficient to see that Θ(n!) functions grow faster.

To mathematically determine the result, we can take the log of both, giving us log (n!) and log nlog n = log n . log n = (log n)2.

Then, since log(n!) = Θ(n log n), and n log n > (log n)2 for any large n, we could derive that Θ(n!) grows faster.

The derivation is perhaps non-trivial, and I'm slightly unsure whether it's actually possible, but we're a bit beyond the scope of Stack Overflow already (try the Mathematics site if you want more details).

Community
  • 1
  • 1
Bernhard Barker
  • 50,899
  • 13
  • 85
  • 122
  • 2
    In fact that holds for every function: `f(n) = Θ(f(n))` regardless of what *f* is. – Niklas B. Mar 25 '14 at 17:51
  • This feels like a non-answer. – G. Bach Mar 25 '14 at 18:08
  • @G.Bach I actually somewhat agree, but, while the question is asking what it's asking, this is the answer (although I can't say I'd be particularly irritated if this question were to end up deleted). If the question were to be *changed* to ask how to compare the two given functions, that should be closed as off topic, since it belongs on [math.se]. – Bernhard Barker Mar 25 '14 at 18:12
0

If you want some sort of "closed form" expressions, you can get n! = Ω((sqrt(n/2))^n) and n! = O(n^n). Note sure those are more useful.

To derive them, see that (n/2)^(n/2) < n! < n^n.

To compare against n^(log n), use limit rules; you may also want to use n = e^(log n).

G. Bach
  • 3,784
  • 2
  • 22
  • 43