HackerPapers

arXiv:1910.06437cs.DS

It is high time we let go of the Mersenne Twister

Sebastiano Vigna

Abstract

When the Mersenne Twister made his first appearance in 1997 it was a powerful example of how linear maps on $\mathbf F_2$ could be used to generate pseudorandom numbers. In particular, the easiness with which generators with long periods could be defined gave the Mersenne Twister a large following, in spite of the fact that such long periods are not a measure of quality, and they require a large amount of memory. Even at the time of its publication, several defects of the Mersenne Twister were predictable, but they were somewhat obscured by other interesting properties. Today the Mersenne Twister is the default generator in C compilers, the Python language, the Maple mathematical computation system, and in many other environments. Nonetheless, knowledge accumulated in the last $20$ years suggests that the Mersenne Twister has, in fact, severe defects, and should never be used as a general-purpose pseudorandom number generator. Many of these results are folklore, or are scattered through very specialized literature. This paper surveys these results for the non-specialist, providing new, simple, understandable examples, and it is intended as a guide for the final user, or for language implementors, so that they can take an informed decision about whether to use the Mersenne Twister or not.

arXiv comments
Journal reference
DOI
Subjects
cs.DSData Structures and Algorithms cs.CRCryptography and Security

On Hacker News

Linked by 3 identifiable commenters in 3 comments across 3 threads, from Oct 2020 to May 2024. Found in 6 HN submissions from Oct 2019 to Oct 2025. Open submission discussions.

Comments linking this paper, per year.

Discussed in comments3 threads

    • This needs "It is high time we let go of the Mersenne Twister" https://arxiv.org/abs/1910.06437 This paper surveys these results for the non-specialist, providing new, simple, understandable examples, and it is intended as a guide for the final user, or for language…

      ReleaseCandidatView on HNParent context

    • Useful. One thing to keep in mind: there’s been a bit of a feud in the PRNG space between the Vigna camp [1] with xoroshiro and newcomer O’Neill [2] with PCG. This website seems stay on the traditional side and shy away from recommending PCG. I’m not really qualified to judge on…

      FabHKView on HNParent context

    • It is very bad. It's is huge, 10x slower than good LCG's, and fails statistical tests, esp. it's lower bits, most wellknown by the Ferrenberg affair. https://arxiv.org/pdf/1910.06437.pdf PCG is also not that good. There do exist proper and fast PRNG's though. DSFMT has the same…

      rurbanView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.