Alex Rivera | Logout

How is the .net random generator implemented?

Asked 2012-06-24T18:44:08.937
8

I mean the standard (?) random generator in .net /c#

Random random = new Random(seed);
random.next();

I know there are tens or hundreds of methods in literature, but I cannot find out which one the .net framework uses currently?

Reason for asking question: if I draw a LOT of random variables, will I ever return to the same sequence. I know some RNG have this undesirable property.

Edit
Report

1 Answer

1

All calculations are based on seed. If you define a seed then for the same sequence of methods you will get the same results. If not then the default seed is the Environment.TickCount, therefore the same sequence of methods will generate different results on each run (not guaranteed in parallels).

answered 2012-06-24T18:52:45.950

Your Answer