Nov 6, 2003 -- RngPack 1.1 released
RngPack 1.1a fixes a number of serious bugs in RngPack 1.0 including an
incorrect coefficient in the Ranecu implementation and an off-by-one
error in the choice() method. RngPack 1.1a supports Java serialization,
adds a coin() method to get true/false coin tosses, adds a synchronized
wrapper and includes a new generator, the Mersenne Twister. All RngPack
users should upgrade to RngPack 1.1a. RngPack 1.1a is now available under
a BSD License. See the Changelog, java class documentation, or download source code in tar.gz
or zip format.
What is RngPack?
RngPack is a pseudorandom number generator package for Java. Pseudorandom
means that the "random" numbers are generated by a deterministic
mathematical process, not by a fundamentally random physical process
such as radioactive decay or Johnson noise. RngPack contains
base classes that add value to random number generators, four research
grade generators, as well as a wrapper for Java's built in random
number generator and a
demonstration application. RngPack
java class documentation. Because RngPack is a set of Java classes
it can be used
in both applications and in applets. RngPack is available under the
What is RngPack good for?
RngPack is good for
- Research applications: the RANLUX, RANMAR,
RANECU and the Mersenne Twister generators are strong generators
research applications where billions and billions of numbers with
low statistical correlations are required. Theoretical studies and
practical tests have been made on all four generators, and all generators
have a history of use in research.
All four generators are portable; given a particular seed, they
generate the same numbers on every machine and produce the same numbers as
FORTRAN implementations. The four research-grade generators all
work with Java Object Serialization.
- Entertainment/Industrial applications: most of our generators run
faster than Math.random() in our tests. Because
RngPack is object-oriented and easy to use, it may be of interest to
people who want smaller numbers of moderate quality numbers.
What isn't RngPack good for?
RngPack is not reccomended for
- Security/Cryptography applications: The generators in RngPack were
designed to have no statistical correlations that would affect large-
scale simulations. They were not designed to be inscrutable to a
mathematically inclined codebreaker. I don't reccomend that you use
Math.random() for cryptography -- instead you
should use algorithms that were designed and tested specifically for
that purpose. JDK 1.1 contains a secure random number generator
designed for cryptography. Probably the best method of key generation
available today is the /dev/random device built into Linux, Solaris and
some other operating systems.
Comparison of generators
(Time is time to generate 10,000,000 numbers on a 300 Mhz Linux computer
running the Sun JDK 1.4.2_02)
(no JIT / JIT)
RANLUX allows the user to adjust the "luxury level"
from 0 to 4 to trade speed for quality. At levels 3 and 4
RANLUX is a large advance in quality over previous generators
|| 4.2 s
Each RANMAR seed within it's range produces a unique sequence;
by splitting up the seed space, collaborating researchers can ensure that
they produce sequences that do not overlap.
||RANECU is an advanced multiplicative linear congruential
||The Mersenne twister has an exceptionally long period and is known to
be well-distributed in 632-dimensional lag space.
||RandomJava wraps up the
Math.random() method that comes
with Java. Not reccomended for general use.
Download RngPack 1.1 asource code as a
gzip-tar file or as a
RngPack is free under a BSD Licence.
If you use RngPack in a project, please
send me an E-mail so I can send you news of updates. I'd
be interested in working with anyone who is interested in improving the
code and incorporating the improvements into future versions.
= honeylocust_trailer() ?>