5
The doubt is very simple, I would like to know how the class System.Random
generates random pseudorandomness numbers from a seed, which I find odd. I know they are not totally random, and so I have my doubts of 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 this seed, it will no longer be random and therefore, this seed will always return the same value in the methods Next
, NextDouble
and NextBytes
?
If yes, how is the algorithm for creating these random numbers based on this seed?
Updating
The core of my question is how the random number is generated based on the seed, and not as this random number is generated. The point was to ask what and how the seed influence in the generation of this number.
Possible duplicate of How computer randomization is generated?
– Bacco
@Bacco updated question to be as clear as possible.
– CypherPotato