On Mon, Aug 23, 2010 at 7:53 PM, Steve Holden <holden...@gmail.com> wrote: > On 8/23/2010 7:48 AM, Russell Keith-Magee wrote: >> On Mon, Aug 23, 2010 at 7:32 PM, Andy <selforgani...@gmail.com> wrote: > [...] >>> Also how random is random - would I get a uniform distribution of >>> records among the shards? >> >> Depending on your level of mathematical rigor, that's not a simple >> question. To a simple approximation, yes, you'll get a uniform >> distribution. However, the patterns and underlying distribution of >> random number generators is the subject of continued research and >> improvement >> > I'll go further and say that the principal authors of the random module > have a degree of numerical and mathematical sophistication that will > tend to guarantee results better than most regular programmers could > provide with their own attempts. > > The random number generation functions are based on the Mersenne twister > algorithm. I certainly wouldn't try to do better myself.
Oh - I certainly agree with that. Just like amateur cryptography, amateur random number generators risk doing more harm than good. I was just trying to make the distinction between "uniform for practical purposes" and "genuinely uniform in the pure sense of the word". Python's random number generator isn't perfect in he mathematical sense -- no programatic random number generator will meet that criterion. However, Python's random will certainly meet the "practical purposes" criterion for most practical purposes, including tasks like shard allocation. Yours, Russ Magee %-) -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.