Archive for George Marsaglia

perfect randomness?

Posted in Books, Statistics, University life with tags , , , , , , , , on July 17, 2026 by xi'an

The New York Times (of 09 June) pointed me to a Nature paper of 27 May 2026 that I had most curiously missed! It is called Experimental randomness amplification and it presents a technique aimed at integrally correcting the bias in quantum random bit generators. Independently from the device used. This is quite interesting, even though I am definitely missing a lot.

“…randomness amplification protocols make use of a Bell test. Bell tests consist of measurements performed on entangled systems. Their purpose is to prove that, under natural locality assumptions, there cannot exist any variables that determine the outcomes of these measurements” Kulikov et al.

Not so perfect then, if relying on a test, a statistical test, cannot provide or prove certainty about the improved predictability of the random generator… The core of the method is described as follows:

“Any source of random bits B1 … Bn can be characterized by a pair of parameters (μ, ε). Like any realistic device, the source may fail with some probability ε, in which case nothing is guaranteed about the randomness of B1 … Bn (…) [Adopting] the Santha–Vazirani (SV) model5, considering an adversary attempting to predict the output bit Bi of the source, we say the source is a μ-SV source if  Pguess(Bi∣E)≤½+μ  holds for all i. Here E denotes any (potentially quantum) side information that is available before the bit Bi is produced (…) and Pguess(Bi∣E) denotes the probability of guessing Bi, given access to E (…) The case μ = 0 corresponds to a perfectly random (unbiased) source, while larger values of μ (…) bias μ quantifies the predictive power of a potential adversary, [with] the assumption that a source is (μ, ε)-random [can] be falsified by a statistical test that yields an observed bias μobs larger than μ. Therefore, if μobs satisfies μobs < μ, we say that the test result is compatible with the (μ, ε)-randomness assumption (…) In this work, we demonstrate that, for any input source with μ ≤ 0.75%, our experimental set-up (…) yields completely unbiased output randomness (…) The residual increase of the failure probability, ε, can in principle be made arbitrarily small at the cost of consuming more input randomness (…) To achieve this, we use two spatially separated sources of randomness [and] treat their concatenated outputs (…) as a single μ-SV source” Kulikov et al.

An assumption of importance in the proof (which I did not check!) is that both (independent) sources of randomness share the same bias μ, furthermore assumed to be constant over time, which should be a concern with physical devices. I also do not understand why a mere concatenation of the outputs saves the day, but quickly browsing the complete paper (aka supplementary information) I found that the final output K is via a two-process extractor that involves several n x n binary matrices even though it achieves a O(n log n) runtime. The NYT article reports that it took nine hours to generate 45 million bits, yes bits… Last remark about checking for pure, uniform, randomness in the experiment by relying on Marsaglie’s Diehard set of tests:

“we generate a random bitstring K consisting of m = 45,025,658 bits, starting from 5,368,709,120 low-quality random bits (…) chosen such that a failure probability of the protocol as low as ε = 10−12 is guaranteed  (…) provided that the bias μ (…) is below 0.75%. Although it is fundamentally impossible to verify the unpredictability of a bitstring by analysing the string itself, we (…) run the NIST statistical test suite and the Diehard batteries of statistical tests [and] the result passes all the tests for which the string is sufficiently long.” Kulikov et al.

Monte Carlo [exam]

Posted in Kids, pictures, R, Statistics, University life with tags , , , , , , , , , , , , , , , , , on January 22, 2025 by xi'an

My final exam for the Monte Carlo course I taught last semester proved too much of a challenge for my fourth year students, despite being rather elementary and centred on accept-reject algorithms and importance/bridge sampling. One of the problems was a decomposition of the truncated Normal simulation method proposed by Marsaglia in 1963, found on X Validated!, which I had posted on the course Teams forum (and discussed on the ‘Og!). Obviously overlooked by the students as hardly anyone solved the central question… Quite a disappointment (and more exams to grade for the resit exam in June!)

another, older, truncated Normal algorithm [X’ed]

Posted in Books, pictures, Statistics, University life with tags , , , , , , on September 23, 2024 by xi'an

truly and uniquely pseudo-random?

Posted in Books, pictures, Statistics, Travel, University life with tags , , , , , , , , , , , , , on July 10, 2024 by xi'an

I came across a Web paper entitled The Impact of Google’s Random Number Generator on Accurate Results that I found most puzzling in failing to explain the specific nature of this random generator and that included gems as below

“PRNGs (…) outputs are inherently predictable given a specific seed value, thus deviating from true randomness”

or stating that linear congruential generators suffered from “discernible patterns”, or yet advancing a bonus in using Google’s generator for “leveraging Gaussian distributions”… Referring to a specific and possibly obscure arXival proposing to construct (yet) a PRNG by reinforced learning, with an objective function based on randomness tests reminded me of Marsaglia’s Die Hard. And to “true randomness”. Plus being repetitive and obsequious. Until I found the piece was “written” by Quthor with no typo, an AI “writer” powered by Quick Creator. I should have paid more attention to the level of nonsense…

On the same occurrence, I also read a recent Scientific American paper on randomness tests pseudo-random number generators by Christopher Lutsko. Which does not start that well, since it reproduces the Laplace démon’s argument that a die roll outcome is not random. Also repeating the above pleonasm that PRNGs are not random since they are deterministic. And failing to not mention lava generators! The core of the article is however about recent papers by the author and Niclas Technau of the only examples of sequences that prove passed extremely strong pseudorandom tests. They focus on tests based on gap distribution and pair correlation.

“The [gap distribution] measures the size of the gaps between the points, and the [pair correlation’ measures the clustering of the points—how much they group up or stay apart (…) If these agree with what we would expect from random data, we say that the gap distribution or pair correlation is “Poissonian”.”  Christopher Lutsko

Along with Athanasios Sourmelidis, they proved that exponential sequences {α exp(θ log[n]) mod 1} have Poissonian pair correlation when θ<⅓, for any value of α. And higher Poissonian correlations for θ “smaller and smaller“. (This does not come out of the blue, as the proof relates to Van der Corput’s method of exponential sums, with links to the leading Austrian random generator community.) This is definitely an achievement. However, when θ gets “smaller and smaller“, the terms in the sequence grow more and more slowly, which forces calling for larger and larger values of α to make the generator useful. And the pseudo-randomness test based on Poissonian correlations is only one of many from the toolbox, so the debate seems far from over.

 

 

piling up ziggurats

Posted in Books, pictures, Statistics, Travel with tags , , , , , , on June 7, 2021 by xi'an

This semester. a group of Dauphine graduate students worked under my direction on simulation problems and resorted to using the Ziggurat method developed by George Marsaglia and Wai Wan Tsang, at about the time Devroye was completing his simulation bible. The algorithm covers the half-Normal density by 2², 2⁴, 2⁸, &tc., stripes, all but one rectangles and all with the same surface v. Generating uniformly from the tail strip means generating either uniformly from the rectangle part, x<r, or exactly from the Normal tail x>r, using a drifted exponential accept-reject. The choice between both does not require the surface of the rectangle but a single simulation y=vU/f(r). Furthermore, for the other rectangles, checking first that the first coordinate of the simulated point is less than the left boundary of the rectangle above avoids computing the density. This method is incredibly powerful, once the boundaries have been determined. With 2³² stripes, its efficiency is 99.3% acceptance rate. Compared with a fast algorithm by Ahrens & Dieter (1989), it is three times faster…