how good is .NET's Random for making random numbers?

  • Thread starter Thread starter Zytan
  • Start date Start date
.NET Random uses "Donald E. Knuth's subtractive random number
generator algorithm" says the docs.

Decompile code indicates that it uses an array of size 56.

It seems to be a special case of modern MRG with coefficients of 1.

Based on that:
- Knuth is who he is
- MRG's are generally considered good
- MS choose that algorithm
then I am sure that it is better than the standard C rand()
based on simple LCG's.

So check if there is a problem and if yes then check your code.

You can do simple tests by tabulating high bits and low bits
in 1D, 2D etc..

Ok, thanks, Arne. From our simple tests, it is better than C's
rand().

Zytan
 
Back
Top