Conceptio › Archive › Stack Exchange
Stack Exchange open access CC BY-SA

Why is the Mersenne Twister regarded as good?

Veedrac · 2015
Stack Exchange · Datasets · License: CC BY-SA · 2015
Open Source ↗
algorithmscssampling
The Mersenne Twister is widely regarded as good. Heck, the CPython source says that it "is one of the most extensively tested generators in existence." But what does this mean? When asked to list properties of this generator, most of what I can offer is bad: It's massive and inflexible (eg. no seeking or multiple streams), It fails standard statistical tests despite its massive state size, It has serious problems around 0, suggesting that it randomizes itself pretty poorly, It's hardly fast and so on. Compared to simple RNGs like XorShift*, it's also hopelessly complicated. So I looked for some information about why this was ever thought to be good. The original paper makes lots of comments on the "super astronomical" period and 623-dimensional equidistribution, saying Among many known measures, the tests based on the higher dimensional uniformity, such as the spectral test (c.f., Knuth [1981]) and the k-distribution test, described below, are considered to be strongest. But, for this property, the generator is beaten by a counter of sufficient length! This makes no commentary of local distributions, which is what you actually care about in a generator (although "local" can mean various things). And even CSPRNGs don't care for such large periods, since it's just not remotely important. There's a lot of maths in the paper, but as far as I can tell little of this is actually about randomness quality. Pretty much every mention of that quickly jumps back to these original, largely useless claims. It seems like people jumped onto this bandwagon at the expense of older, more reliable technologies. For example, if you just up the number of words in an LCG to 3 (much less than the "only 624" of a Mersenne Twister) and output the top word each pass, it passes BigCrush ( the harder part of the TestU01 test suite ), despite the Twister failing it ( PCG paper, fig. 2 ). Given this, and the weak evidence I was able to find in support of the Mersenne Twister, what did cause atten
Conceptio Open Archive

Analyze & explore related research in Conceptio

Connect this record directly into your research workflow or AI agent. Explore citations across open repositories, query full text, and export structured proof bundles.

This document is indexed with metadata only: full text is not available in the archive for this record. Open the official source ↗

Related documents

Record · ID 796596
Retrieved via Conceptio: every document is proof-bundled with source, license, and retrieval metadata.
Bring this data into your agent: Connect via MCP or API · 20 free credits to start · no card required
Read the Docs → · View CLI source on GitHub · Conceptio Open Knowledge Archive