[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: need some Ruby magic

Martin DeMello

12/7/2005 8:24:00 PM

Stephen Waits <steve@waits.net> wrote:
>
>
> This is really just meant to be a simple hack. I think a better
> algorithm could assign a random index to each element, then sort on
> those indices.

http://www.rubygarden.org/ruby?Ar... is a variant of your code,
with a nice proof that it's unbiased.

http://c2.com/cgi/wiki?Lin... has a lot of discussion on
shuffling algorithms.

martin
1 Answer

Stephen Waits

12/7/2005 9:16:00 PM

0

Martin DeMello wrote:
> http://www.rubygarden.org/ruby?Ar... is a variant of your code,
> with a nice proof that it's unbiased.
>
> http://c2.com/cgi/wiki?Lin... has a lot of discussion on
> shuffling algorithms.

Thanks Martin!

--Steve