<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>PCG, A Better Random Number Generator (Posts about jsf)</title><link>http://www.pcg-random.org/</link><description></description><atom:link href="http://www.pcg-random.org/categories/jsf.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2026 &lt;a href="mailto:oneill@pcg-random.org"&gt;M.E. O'Neill&lt;/a&gt; </copyright><lastBuildDate>Sat, 10 Jan 2026 18:23:33 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Efficiently Generating a Number in a Range</title><link>http://www.pcg-random.org/posts/bounded-rands.html</link><dc:creator>M.E. O'Neill</dc:creator><description>&lt;div&gt;&lt;p&gt;The vast majority of my posts about random number generation have focused on looking at the properties of different generation schemes.  But, perhaps surprisingly, the performance of your randomized algorithm may hinge not on the generation scheme you chose, but on other factors.  In this post (inspired by and building on an excellent &lt;a href="https://arxiv.org/abs/1805.10941"&gt;recent paper by Daniel Lemire&lt;/a&gt;), we'll explore a common source of overhead in random number generation that frequently outweighs PRNG engine performance.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.pcg-random.org/posts/bounded-rands.html"&gt;Read more…&lt;/a&gt; (27 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>gjrand</category><category>jsf</category><category>lcg</category><category>mt19937</category><category>pcg</category><category>performance</category><category>sfc</category><category>splitmix</category><category>xoroshiro</category><category>xorshift*</category><category>xoshiro</category><guid>http://www.pcg-random.org/posts/bounded-rands.html</guid><pubDate>Sun, 22 Jul 2018 21:12:28 GMT</pubDate></item><item><title>Some (More) C++ PRNG Implementations</title><link>http://www.pcg-random.org/posts/some-prng-implementations.html</link><dc:creator>M.E. O'Neill</dc:creator><description>&lt;div&gt;&lt;p&gt;Nearly a year ago, I wrote a post suggesting &lt;a href="http://www.pcg-random.org/posts/other-good-options.html"&gt;some good alternatives to PCG&lt;/a&gt;.  As part of that post, I included links to C++ implementations of those PRNGs, following C++-11 conventions (although omitting rarely-used features such as state I/O).&lt;/p&gt;
&lt;p&gt;Since that post, I've written my own C++ implementations of a few more generation schemes.  Links and brief descriptions below.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.pcg-random.org/posts/some-prng-implementations.html"&gt;Read more…&lt;/a&gt; (3 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>arc4</category><category>gists</category><category>gjrand</category><category>jsf</category><category>lcg</category><category>sfc</category><category>splitmix</category><category>xoroshiro</category><category>xoshiro</category><guid>http://www.pcg-random.org/posts/some-prng-implementations.html</guid><pubDate>Wed, 04 Jul 2018 06:48:01 GMT</pubDate></item><item><title>Exploring Xoshiro's Close-Repeats Flaw</title><link>http://www.pcg-random.org/posts/xoshiro-repeat-flaws.html</link><dc:creator>M.E. O'Neill</dc:creator><description>&lt;div&gt;&lt;p&gt;In &lt;a href="http://www.pcg-random.org/posts/implausible-output-from-xoshiro256.html"&gt;a recent post&lt;/a&gt;, I noted that the Vigna and Blackman's new &lt;a href="http://xoshiro.di.unimi.it"&gt;Xoshiro&lt;/a&gt; family of PRNGs is prone to some implausible repeats.  I hinted then that I'd write a longer article providing a more in-depth discussion of the issues.  This is that article.&lt;/p&gt;
&lt;p&gt;We'll begin with a slightly deeper exploration of zeroland (which is how I discovered the issue), see how that leads us to find Xoshiro's near-repeats problems, and, finally, determine just how significant the problem is.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.pcg-random.org/posts/xoshiro-repeat-flaws.html"&gt;Read more…&lt;/a&gt; (31 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>gjrand</category><category>jsf</category><category>testing</category><category>xoroshiro</category><category>xoshiro</category><guid>http://www.pcg-random.org/posts/xoshiro-repeat-flaws.html</guid><pubDate>Mon, 02 Jul 2018 00:41:46 GMT</pubDate></item><item><title>Random Invertible Mapping Statistics</title><link>http://www.pcg-random.org/posts/random-invertible-mapping-statistics.html</link><dc:creator>M.E. O'Neill</dc:creator><description>&lt;div&gt;&lt;p&gt;In my &lt;a href="http://www.pcg-random.org/posts/bob-jenkins-small-prng-passes-practrand.html"&gt;previous post&lt;/a&gt;, I looked at Bob Jenkins's JSF PRNG which has, at its heart, a random &lt;em&gt;invertible&lt;/em&gt; mapping rather than a random (noninvertible) mapping.  &lt;/p&gt;
&lt;p&gt;I discussed the theory of random (noninvertible) mappings in my post “&lt;a href="http://www.pcg-random.org/posts/too-big-to-fail.html"&gt;&lt;em&gt;Too Big To Fail&lt;/em&gt;&lt;/a&gt;”, which looked at the behavior generators based on this idea.  Although random (noninvertible) mappings produce PRNGs that I consider needlessly flawed (for general-purpose use), their behavior is at least well characterized in the academic literature, particularly by Philippe Flajolet (e.g., &lt;a href="http://algo.inria.fr/flajolet/Publications/book.pdf"&gt;&lt;em&gt;Analytic Combinatorics&lt;/em&gt;&lt;/a&gt;, section VII.3.3 pages 462-467).&lt;/p&gt;
&lt;p&gt;Random &lt;em&gt;invertible&lt;/em&gt; mappings have different properties, being based on a random bijection (which means that the generator can tick backwards as well as forwards if desired), whereas a random (noninvertible) mapping merely requires a random function (which may not be able to go backwards because there is no guarantee that there is only one place we could have come from).  &lt;/p&gt;
&lt;p&gt;If I were to search the literature, I would not be surprised to find that someone else has done a similar analysis of random invertible mappings.  But a quick Google search revealed nothing, and, for me at least, deriving results myself is far more fun than searching for results derived by others, and often a good deal faster if there are no immediate leads. So that's what I've done.  Now, hopefully, if someone Googles it, they'll find &lt;em&gt;something&lt;/em&gt;.  But if you have a good source to cite, please contact me and I'll update this article.&lt;/p&gt;
&lt;p&gt;STOP PRESS: After I posted this article, I found the right term, which turns out not to be &lt;em&gt;random invertible mapping&lt;/em&gt; but &lt;em&gt;random permutation&lt;/em&gt;.  As it turns out, there is a whole &lt;a href="https://en.wikipedia.org/wiki/Random_permutation_statistics"&gt;Wikipedia article on random permutation statistics&lt;/a&gt; which has some of the results I derived here.  I've left my derivations in place because I think they are useful, but you should definitely check out that article as well.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.pcg-random.org/posts/random-invertible-mapping-statistics.html"&gt;Read more…&lt;/a&gt; (4 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>jsf</category><category>testing</category><category>theory</category><guid>http://www.pcg-random.org/posts/random-invertible-mapping-statistics.html</guid><pubDate>Tue, 29 May 2018 00:29:29 GMT</pubDate></item><item><title>Bob Jenkins's Small PRNG Passes PractRand (And More!)</title><link>http://www.pcg-random.org/posts/bob-jenkins-small-prng-passes-practrand.html</link><dc:creator>M.E. O'Neill</dc:creator><description>&lt;div&gt;&lt;p&gt;I've been chatting on and off with David Blackman since August, 2017.  Over our various conversations, I've gained huge respect for him and his contributions to random number generation over the last 15 years.  In the course of a recent conversation I asked him about some of his favorite random number generators, and one of the ones he mentioned was &lt;a href="http://burtleburtle.net/bob/rand/smallprng.html"&gt;&lt;em&gt;A Small Noncryptographic PRNG&lt;/em&gt;&lt;/a&gt; by Bob Jenkins.  Even though I had previously been aware of some of Bob Jenkins's other work regarding hash functions, somehow his work on noncryptographic  random number generation fell through the cracks when I was surveying things that were out there back in 2014.  I'll remedy that omission now.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.pcg-random.org/posts/bob-jenkins-small-prng-passes-practrand.html"&gt;Read more…&lt;/a&gt; (26 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>jsf</category><category>practrand</category><category>testing</category><guid>http://www.pcg-random.org/posts/bob-jenkins-small-prng-passes-practrand.html</guid><pubDate>Sun, 27 May 2018 23:08:33 GMT</pubDate></item></channel></rss>