I think it’s safe to say that the Random Article feature isn’t completely random – or at least it chooses from a select pool of high-quality articles. I’m just genuinely curious what that is.
3 Likes
Agreed. I think it should be a broader selection of articles, including ones that are promoted, but not rising star or featured.
2 Likes
The Random Article button (or as wikiHow calls it, Special:Randomizer) is built into the MediaWiki software.
For those who wanna know the nerdy technical stuff, I found this interesting tidbit about Wikipedia’s own Random Article feature (from Wikipedia:FAQ/Technical - Wikipedia
):
Is the “random article” feature really random?
No, although it’s random enough to provide a small sample of articles reliably.
In the Wikipedia database
, each page is assigned a “random index”, which is a random floating point number uniformly distributed between 0 (inclusive) and 1 (exclusive). The “random article” feature (Special:Random) chooses a random double-precision floating-point number
, and returns the next article whose random index is greater than the selected random number. Some articles will have a larger gap before them, in the random index space, and so will be more likely to be selected. So the actual probability of any given article being selected is in fact itself random.
The random index value for new articles, and the random value used by Special:Random, is selected by reading two 31-bit words from a Mersenne twister
, which is seeded at each request by PHP’s initialisation code using a high-resolution timer and the PID. The words are combined using:
(mt_rand() * $max + mt_rand()) / $max / $max
This may or may not be how wikiHow’s Random Article feature works as well because keep in mind that we use an older version of MediaWiki. I’m not even gonna pretend like I understand the CompSci jargon in that FAQ
2 Likes
Special:Random and Special:Randomizer are not random because they are written using software, and software uses math to work, and math can never be random. If you write an equation, then the answer of that equation will always be the same. 2+2 will always equal 4, no matter what. You can generate a Pseudorandom number though. You can use some sort of factor in the environment to generate what would seem like a random number. Like Zygomatt said above, what Mediawiki essentially does is that it generates a Pseudorandom number by using a very complex equation and then adds in some sort of environmental factor. In this case, the environmental factor appears to be a timer that is used in PHP’s code. So their appears to be a variable in this complex equation and the number of seconds is placed in the variable and then the equation is calculated. Then the article is selected based on the result. This isn’t truly random because you can
technically predict the result, but it’s random enough for the purpose of the random article feature. This works because every MediaWiki article has an ID number assigned to it.
In wikiHow’s case, Special:Randomizer only selects articles that are promoted. The details of how Special:Randomizer works are not published, so I will speculate that it either rounds the result up or down to the closet article, or it has a separate labeling system for them.
Note: I think this is how it works, based on how I read that quoted MediaWiki documentation entry.
3 Likes
JayneG
5
Great question and there are some interesting findings in this thread already! Checking around, it seems that it pulls from a variety of articles including featured articles, rising stars, articles with high views, articles with a lot of edits, and ones that have high helpfulness ratings
3 Likes