Hi, On 15.12.2004, at 09:38, Ralf Mler wrote: > > Hi Ilmari, > its a bit OT, but I'd like to know, how you test the methods above. > How could you know, there is as much randomness as you want? Short answer: I don't. Bad, yes. Long answer: The only probabilistic test is for #shuffle, which tries 10 times to get a shuffled array that != original array. The rest trust that Kernel#rand provides random numbers and compare the picked values to the original array to check that they all are from the original array. I guess one way to test the randomness would be to collect an array from the picked values that's much larger than the original. Then check the distribution by checking that the entry counts normalized to array length (amt of item / array.length) are close enough to the original array's normalized counts. And check the randomness of the order by gzipping a long randomized string and checking that it compresses badly. -Ilmari