Huh.

I mis-thunk this one.

On first read, it looked like Drunkard’s Walk v. Iterative Brute Force, which I thought favored Drunkard’s Walk.

Except that that’s wrong, because the ‘you’ll find it halfway through’ rule applies to Brute Force, while the random replacement isn’t actually a Drunkard’s Walk. ]]>

Huh.

I mis-thunk this one.

On first read, it looked like Drunkard’s Walk v. Iterative Brute Force, which I thought favored Drunkard’s Walk.

Except that that’s wrong, because the ‘you’ll find it halfway through’ rule applies to Brute Force, while the random replacement isn’t actually a Drunkard’s Walk. ]]>

Just saw this post, and I’m happy to say I thought of an answer (twice as long on ave for random, assuming random is allowed to repeat – man, being in medicine makes it easy to forget math!), but then I thought of something else – what about the actual time needed for the machine to actually create the list? Would it depend on the language (I assume), but likely makes the random list that much longer unless there’s a pre-defined set? Also, if it has to test each iteration to see if it’s fully sorted, it rejects it the first item that isn’t sorted… ack, me bwane huwts!

*sigh* Yony, you can tell I miss you, right? ðŸ™‚ (btw, there’s a pic of the 3 of us up on my website)

I usually ask them “What question did you want me to ask that I didn’t?” or “Anything you want to tell me that I didn’t ask about?”. I’ll be adding this one immediately! ðŸ˜‰ ]]>

Just saw this post, and I’m happy to say I thought of an answer (twice as long on ave for random, assuming random is allowed to repeat – man, being in medicine makes it easy to forget math!), but then I thought of something else – what about the actual time needed for the machine to actually create the list? Would it depend on the language (I assume), but likely makes the random list that much longer unless there’s a pre-defined set? Also, if it has to test each iteration to see if it’s fully sorted, it rejects it the first item that isn’t sorted… ack, me bwane huwts!

*sigh* Yony, you can tell I miss you, right? ðŸ™‚ (btw, there’s a pic of the 3 of us up on my website)

I usually ask them “What question did you want me to ask that I didn’t?” or “Anything you want to tell me that I didn’t ask about?”. I’ll be adding this one immediately! ðŸ˜‰ ]]>

Woohoo! My math has not failed me. ðŸ™‚ ]]>

You are, and you win! ðŸ™‚ ]]>

Foo. Am I really the first one to answer? ]]>

This looks to me like sampling with and without replacement.

Iterating over all permutations is sampling without replacement. That’s n choose 1, (in other words, there are n! permutations), and on average, we’ll find the correct one halfway through. So it’s O(n!), with a constant of .5.

Random iterations is sampling with replacement, and the sample space is again all the permutations So it becomes a geometric distribution with probability of success 1/n!, and the expected time to success is 1/(1/n!), or n!. (but without the reduced constant.)

So random permutations is twice as inefficient.

Going to peek now! ]]>