Appendix E. Random Sequence

Random numbers are used inside modeFRONTIERTM for some DOEs (Random Sequence, Monte Carlo) for many Shedulers (MOGA, Simulated Annealing, MOSA, MACK, FMOGA, DES, MMES) and for Response Surfaces (Kriging, Neural Net, Gaussian Processes).

For these algorithms, it is convenient that a series of random numbers can be replayed for use in several times, and "pseudo-random numbers" are well suited for this purpose. We used the name "pseudo-random" instead of "random" because a computer runs programs following instructions and therefore cannot do something by chance. So, computer can generate only pseudo-random sequences that are not truly random because they are computed from a mathematical formula. Anyhow, modern algorithms for generating pseudo-random sequence are so good that the numbers look exactly like they were really random.

modeFRONTIERTM uses routines from the standard Java Random library to generate a stream of pseudorandom numbers.

This is an abstract from JAVA documentation:

		If two instances of Random are created with the same seed, and the
		same sequence of method calls is made for each, they will generate and
		return identical sequences of numbers. In order to guarantee this
		property, particular algorithms are specified for the class Random.
		Java implementations must use all the algorithms shown here for the
		class Random, for the sake of absolute portability of Java code.
		However, subclasses of class Random are permitted to use other
		algorithms, so long as they adhere to the general contracts for all the
		methods.
	

Next

		protected int next(int bits)
	

Generates the next pseudorandom number.

The general contract of next is that it returns an int value and if the argument bits is between 1and 32 (inclusive), then that many low-order bits of the returned value will be (approximately) independently chosen bit values, each of which is (approximately) equally likely to be 0 or 1. The method next is implemented by class Random as follows:

	synchronized protected int next(int bits) {
			seed = (seed * 0x5DEECE66DL + 0xBL) & ((1L << 48) - 1);
			return (int)(seed >>> (48 - bits));
	}
	
This is a linear congruential pseudorandom number generator, as defined by D. H. Lehmer and described by Donald E. Knuth in "The Art of Computer Programming," Volume 2: Seminumerical Algorithms, section 3.2.1.

NextDouble

		public double nextDouble()
	

Returns the next pseudorandom, uniformly distributed double value between 0.0 and 1.0 from this random number generator's sequence.

The general contract of nextDouble is that one double value, chosen (approximately) uniformly from the range 0.0d (inclusive) to 1.0d (exclusive), is pseudorandomly generated and returned. All 253 possible float values of the form m * 2-53, where m is a positive integer less than 253, are produced with (approximately) equal probability. The method nextDouble is implemented by classRandom as follows:

		public double nextDouble() {
		       return (((long)next(26) << 27) + next(27))
		                  / (double)(1L << 53);
	}
	

The hedge "approximately" is used in the foregoing description only because the next method is only approximately an unbiased source of independently chosen bits. If it were a perfect source or randomly chosen bits, then the algorithm shown would choose double values from the stated range with perfect uniformity.


Return to modeFRONTIER Index


Your Ad Here