Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I haven't been able to find the source code for the function quickly; seeing it might help get a better answer. That said, it looks like a 'no.. but kinda close'.</p> <p>From documentation I can see it tries to be random (and optionally you can seed it); but there are two caveats that mean it might not always be uniform when you expect it to the first issue is in it's documentation:</p> <pre><code>RAND() is not meant to be a perfect random generator. It is a fast way to generate random numbers on demand that is portable between platforms for the same MySQL version. </code></pre> <p>i.e. the code for it is questionable in being a true random number generator - it's good enough for most purposes, but can't be trusted for use in, say, encryption, and I'd wager can't be trusted to even be as uniform as you may expect.</p> <p>Their claim that it's not perfect means it will almost certainly fail at least some of these tests; the how is still unclear, but if it's not a perfect RNG, you won't see a perfectly uniform distribution; I'd expect either gaps or peaks of ranges that are more/less common. <a href="http://www.stat.fsu.edu/pub/diehard/cdrom/pscript/monkey.ps" rel="nofollow">http://www.stat.fsu.edu/pub/diehard/cdrom/pscript/monkey.ps</a> (there's been other work since but this is still some of the key work in validating RNG's).</p> <p>It'd wager that code behind it certainly does <em>not</em> try to guarantee a uniform distribution, since to do so (track history of what's come up already) would waste masses of memory. In any case, if you've already generated a lot of values using a perfect RNG, nothing guarantees that if your values so far were all low the next one will be high. It will always be just as random..</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload