Θ(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).