Here's some relevant code snippets from SpecialRandomPage.php:
$rand = mt_rand() / mt_getrandmax(); $randstr = number_format( $rand, 12, ".", "" );
$sqlget = "SELECT cur_id,cur_title FROM $cur $use_index WHERE cur_namespace=0 AND cur_is_redirect=0 $extra AND cur_random>$randstr ORDER BY cur_random LIMIT 1";
Here's the PHP documentation on mt_rand():
The salient points are:
* A random number is generated using the PHP function mt_rand() * That number is used to find an article in the default namespace (not a redirect) with the closest greater cur_random value than the generated number. * The cur_random value is generated with mt_rand() and saved with the article in Article.php.
It appears that if multiple articles should happen to share the same cur_random number, you could end up with a slight bias, since then the choice of which article to return is determined by how the database decides to order the articles, and if this isn't arbitrary then some articles are less likely to be returned than others. The degree of non-randomness that this implies probably depends on the number of articles and the range of the assignable random numbers.
Hope this helps, Alan