The question is quite simple, I would like to know how the System.Random
class generates random pseudorandom numbers from a seed, which I think is rather strange. I know they are not totally random, and so I have my doubt as to how they are actually generated. For example,
int x = new Random(123).Next(1, 100);
x
will have a random value, but if I always use that seed, it will not be random anymore and therefore, that seed will always return the same value in methods Next
, NextDouble
and NextBytes
? p>
If yes, what is the algorithm for creating these random numbers based on this seed?
Update
The center of my question is how random number is generated based on seed , not how that random number is generated . The focus of the question was to ask what and how the seed influence the generation of this number.