vix.ing · top · new · best · stats · spec

Design Flaws in the Implementation of the Ziggurat and Monty Python methods (and some remarks on Matlab randn)

2006/03/02 by Boaz Nadler, Nadler, Boaz · 1 citation
Computer Science · Mathematics · #65C10 #Algorithms and Data Compression #Coding theory and cryptography #FOS: Mathematics #Probability (math.PR) #Statistics Theory (math.ST) #math.PR #math.ST #msc:65C10 #semigroups and automata theory #stat.TH

paper · pdf · doi:10.48550/arxiv.math/0603058

16 pages, 1 figure

arxiv created 2006/03/02 · openalex publication_date 2006/03/02 · arxiv updated 2009/12/01 · openalex created_date 2025/10/10 · openalex updated_date 2026/07/28

Abstract

\em Ziggurat and \em Monty Python are two fast and elegant methods proposed by Marsaglia and Tsang to transform uniform random variables to random variables with normal, exponential and other common probability distributions. While the proposed methods are theoretically correct, we show that there are various design flaws in the uniform pseudo random number generators (PRNG's) of their published implementations for both the normal and Gamma distributions \citeZiggurat,Gamma,Monty. These flaws lead to non-uniformity of the resulting pseudo-random numbers and consequently to noticeable deviations of their outputs from the required distributions. In addition, we show that the underlying uniform PRNG of the published implementation of Matlab's randn, which is also based on the Ziggurat method, is not uniformly distributed with correlations between consecutive pairs. Also, we show that the simple linear initialization of the registers in matlab's randn may lead to non-trivial correlations between output sequences initialized with different (related or even random unrelated) seeds. These, in turn, may lead to erroneous results for stochastic simulations.

Cited by

Related