News for hackers. Stuff that matters.
Re:Bogo-bogosort by duncanwest on Saturday December 28, 2013 @06:41PM (#6977186)
You say it will take on average n! attempts to find a sorted list randomly. This is false. It will take on average n!/2 attempts.
Re:Bogo-bogosort by deletes on Saturday December 28, 2013 @06:46PM (#6977213)
O(n!/2) == O(n!), the whole paragraph is obviously referring to big o notation.

edit:( I have edited the post to respond to your comment, trying to clarify what OP meant; I in no way tried to make your comment "look silly" )

Re:Bogo-bogosort by duncanwest on Saturday December 28, 2013 @06:48PM (#6977218)
Yes, but that's not what he says. He says "The loop will repeat on average n! times". That's not true. He's not referring to O notation there, he brings that in later. Here he's talking about the imperative number of times a loop will run on average.

Edit: you've edited your paragraph to make my reply look silly. The whole paragraph is not in O notation. In fact - the exact opposite. In the last sentence of that paragraph he shows what the expression with constant factors looks like before converting it into O notation, and it's wrong! "The product (n-1)n! is O(n × n!)." Bzzzzzzt! Wrong! He should say "The product (n-1)(n!/2) is O(n × n!)."

Re:Bogo-bogosort by aquamongoose on Saturday December 28, 2013 @06:57PM (#6977268)
True, but that's still O(n!), so the overall complexity doesn't change.
Re:Bogo-bogosort by thetwiceler on Saturday December 28, 2013 @10:32PM (#6978170)
The mean would certainly be n! (note that it is possible, and even likely, that you may create the same sorting multiple times by random chance).

The median, which I don't think you're referring to, is something else (I imagine it would be substantially less than the mean).

(See http://en.wikipedia.org/wiki/Geometric_distribution)