Why is the Java implementation of Random.setSeed xor a parameter with 0x5DEECE66DL?

See http://docs.oracle.com/javase/7/docs/api/java/util/Random.html#setSeed(long) . Code xors seed with a factor before decreasing its mod 2 ^ 48. Why not just reduce the passed seed mode 2 ^ 48? C-equivalent seed48 does not execute xor.

+4
source share
1 answer

You can find a nice reading here: java.util.Randoms Magic Number 0x5DEECE66D .

and quote:

The analysis says it was chosen simply because researchers determined empirically that it produces a sequence of values satisfying various randomness tests 

And this Document also gives a shot at the Magic number.

and another quote:

Then I tried searching for the decimal value, excluding Java, and found the answer in some class notes:

http://nut.bu.edu/~youssef/py502/monte_carlo_supplement.ps http://www.inf.ethz.ch/personal/gaertner/texts/own_work/random_matrices.pdf

 and in some computer documentation: 

http://developer.apple.com/documentation/Darwin/Reference/ManPages/html/_rand48.3.html

 The Youssef notes say: ... I can only say that 25214903917_LONG and 11_LONG have apparently been chosen by passing a battery of such [meaning Marsaglia DIEHARD] tests. ... Even in the case of the 48-bit generators we are discussing today, cas26 will generate them all in a month or two of CPU time and then start to repeat. 
+3
source

All Articles