[latex3-commits] [git/LaTeX3-latex3-latex3] master: Mention a third mild issue with the engine's RNG [ci skip] (eff6b81)

Bruno Le Floch bruno at le-floch.fr
Sun May 6 23:45:15 CEST 2018

Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/eff6b816fc5589aac6efb3dac4e277cccdd93c46


commit eff6b816fc5589aac6efb3dac4e277cccdd93c46
Author: Bruno Le Floch <bruno at le-floch.fr>
Date:   Sun May 6 17:45:15 2018 -0400

    Mention a third mild issue with the engine's RNG [ci skip]


 l3kernel/l3fp-random.dtx |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/l3kernel/l3fp-random.dtx b/l3kernel/l3fp-random.dtx
index ed22ef4..c319367 100644
--- a/l3kernel/l3fp-random.dtx
+++ b/l3kernel/l3fp-random.dtx
@@ -131,7 +131,7 @@
 % increased.  In our code, we shall thus combine several results from
 % the RNG\@.
-% The RNG has two types of unexpected correlations.  First, everything
+% The RNG has three types of unexpected correlations.  First, everything
 % is linear modulo~$2^{28}$, hence the lowest $k$ bits of the random
 % numbers only depend on the lowest $k$ bits of the seed (and of course
 % the number of times the RNG was called since setting the seed).  The
@@ -161,6 +161,13 @@
 % will have more complicated coefficients than $\pm 1$, which alleviates
 % the issue.
+% Third, consider successive batches of $165$ calls to the RNG (with
+% argument $2^{28}$ or with argument~$2$ for instance), then most
+% batches have more odd than even numbers.  Note that this does not mean
+% that there are more odd than even numbers overall.  Similar issues are
+% discussed in Knuth's TAOCP volume 2 near exercise 3.3.2-31.  We do not
+% have any mitigation strategy for this.
 % Ideally, our algorithm should be:
 % \begin{itemize}
 % \item Uniform.  The result should be as uniform as possible assuming

More information about the latex3-commits mailing list