From: Martin DeMello Date: 2005-12-08T05:27:35+09:00 Subject: Re: need some Ruby magic Stephen Waits 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?ArrayShuffle is a variant of your code, with a nice proof that it's unbiased. http://c2.com/cgi/wiki?LinearShuffle has a lot of discussion on shuffling algorithms. martin