"MonkeeSage" <[EMAIL PROTECTED]> writes: > Taking your comment and running with it...this is pretty much > cheating, and requires that M be evenly divisible by N, and only works > well with smaller N values, and selections are limited to numbers in > the 1 to (M/N)+(M/N) range...but hey; other than that it's perfect, heh.
This still doesn't make terribly much sense in terms of the distribution you get. The fencepost method still seems to be simplest: t = sorted(random.sample(xrange(1,50), 4)) print [(j-i) for i,j in zip([0]+t, t+[50])] -- http://mail.python.org/mailman/listinfo/python-list