Talk:Find the missing permutation: Difference between revisions

→‎Perl shuffle: This is all very typical, and non-worrisome
(→‎Perl shuffle: This is all very typical, and non-worrisome)
Line 18:
::: Heh. I didn't try running several times, so that one result set definitely isn't a representative sample. However I do use that Perl script for a few other things at home (It's great for shuffling things before they get to xargs when doing '''find'''-based playlists). I tried adding a reverse and reshuffle stage (the Knuth shuffle itself sits in its own function), and had elements pop up near the beginning of the list I'd forgotten I'd even had. That suggests to me there's something broken about my Perl implementation's rand function. As the Wp artical mentions, your shuffle quality is limited by your source of random numbers. I'll write a program some time today to do a more representative search and check of the results I noticed. --[[User:Short Circuit|Michael Mol]] 16:05, 24 December 2009 (UTC)
:::: Yeah, [http://www.jstatsoft.org/v11/i01/paper this paper (see page 48)] suggests that <code>perl</code>'s <code>rand</code> isn't guaranteed to be much good. —[[User:Underscore|Underscore]] ([[User talk:Underscore|Talk]]) 17:15, 24 December 2009 (UTC)
::::: The table on p.53 shows about what I'd expect; the standard rand() is not suitable for either crypto or (proper) Monte Carlo use, and this is normal for a general use RNG in any language. But for shuffling a short list of permutations for a RC task, well, it's just fine. The mixing up is just to make the answer not blindingly obvious after all. –[[User:Dkf|Donal Fellows]] 19:00, 24 December 2009 (UTC)
 
== Prototype Tcl Solution ==
Anonymous user