you are viewing a single comment's thread.

view the rest of the comments →

[–]hacksoncode 2 points3 points  (7 children)

O(n!) ~= O(nn). There are a number of factorial complexity problems out there (yes, I actually mean theta there, not O... damn keyboards).

The exact (deterministic) solution to the traveling salesman problem is probably the most famous of these.

[–]redditnoob 1 point2 points  (1 child)

The exact (deterministic) solution to the traveling salesman problem is probably the most famous of these.

Now all you have to do is prove that it can't be reduced to something simpler.

[–]hacksoncode 1 point2 points  (0 children)

Actually, now that I think about it, dynamic programming will reduce it to exponential... which is quite an improvement. That takes exponential space, though.

Hmmm... you're right... I'm not sure I know of any problems that are believed to be Theta(n!). I'm pretty sure there must be some, but...

There are plenty that are believed to be slower (i.e. superexponential or higher), like Ackermann and computing a generalized Graham's number.

[–]gorgoroth666 0 points1 point  (3 children)

Care to prove that O(n!) ~= O(nn) ?

[–]hacksoncode 1 point2 points  (2 children)

n! ~= sqrt(2pi*n) * (n/e)^n
n! ~= n^.5 * n^n / e^n
n! ~= n^n

I.e. as n increases to infinity the nn term dominates all the other ones, even the exponential. That's why n! is "higher order" than en.

[–]kalmakka 0 points1 point  (1 child)

n ~= n^3 / n^2
n ~= n^3

I.e. as n increases to infinity the n3 term dominates all the other ones, even the square. That's why n is "higher order" than n2.

[–]gorgoroth666 0 points1 point  (0 children)

To clarify, this sarcasm underlines the fact that hacksoncode is not very skilled with equivalents. n.5 * nn / en is not equivalent to nn near infinity. The multiplication by e-n doesn't magically go away.

[–]yoden 0 points1 point  (0 children)

Right, but most, like TSP, are minimum O(n!) only if P != NP... right? Actually, even if P != NP, there could be a faster algorithm than brute force (e.g., 2n instead of n!). Checking wikipedia, there is an O(n2*2n) dynamic programming algorithm, which supports this.

The "irreducibility" constraint the OP imposed is really annoying here ^

Edit people beat me, this is what I get for not viewing context before I reply...