Open source software and

Portable random number generators

This part of my site gets down in the trenches. You can use the information in this section to include various random number generators in your programs or to test generators. I also have a preliminary working paper on the economics of open-source software available here. 

Open Source Software

I wrote a preliminary paper on “The Economics of Open-Source Software.” Open source software is an intriguing issue. This paper is more of a discussion piece than a research paper. It is incomplete but I have not seen anyone else explain open source software this way.

The bottom line of my analysis is that open-source software does not rely on altruistic or starving programmers to succeed, and open-source software will succeed for certain kinds of software. Open-source software is not going to be the only way that software ever is written though. These predictions seem to be borne out by subsequent developments.

Open-source software is a heated subject, with talk of revolutions and returns to the glory days of prior, supposedly altruistic days instead of the rampant greed today. It makes great prose and fun reading. In the end, though, there is one thing that can be said: anyone who is seriously inclined to think this should read and absorb a good principles of economics book like Paul Heyne’s The Economic Way of Thinking.

Random Number Generators

The articles on random number generators focus on explaining and implementing the commonly used congruential generators.  Code in C is included that you can use or translate into other languages.

Some of the articles focus on tests of generators.  These tests examine properties of generators that are important to users.  Failure almost surely means that the output will be inadequate to a user.  Correctly implemented, common generators pass these tests.

I have written some articles on random number generators for C/C++ Users Journal.  These articles are available in some libraries.

"Quick and Portable Random Number Generators". C/C++ Users Journal 13 (June 1995), 33-44.

"Testing Random Number Generators". (with K. B. Williams.) C/C++ Users Journal 14 (June 1996), 39-48.

"Testing Random Number Generators: Part 2". (with K. B. Williams.) C/C++ Users Journal 14 (August 1996), 55-66.

The C/C++ Users Journal web site is http://www.cuj.com/. The code from the articles is no longer available at their website but it is available in the zip file random.zip.

The ThinAir C++ class library defines a simple, powerful interface to a set of pseudo-random number generators, including the DwyerRandGen generator. The home page for G. Wade Johnson’s ThinAir pseudo-random number generator library is http://www.anomaly.org/ThinAir/.

Someone who proposes a new generator should have a better generator, not just one as good as those already available. The “Testing ...” papers in C/C++ Users Journal discuss many tests that are designed to trip up generators. 

K.B. and I have written two other papers that are directed at economists (and others) who are not programmers.

Portable Random Number Generators” is a short summary of our research on finding better combination congruential generators. This is our final draft of the paper that appeared in the Journal of Economic Dynamics and Control in January 2003.

“Portable Random Number Generators: An Exposition”, is an expository paper for economists available here in two parts. This paper includes everthying in the shorter published paper plus exposition of the programming issues. The first downloadable file random.pdf includes the text, tables and code. The second part randfigs.pdf (2.5MB) includes the three figures. Sorry about the size of the figures, but the figures convey a lot of information that wouldn’t be there if they were smaller.

The zip file random.zip contains code for combined generators in C and C++ with the best parameters from the calculations summarized in the Journal of Economic Dynamics and Control article.

The C code for the generator is in the file randcomb.c