3 ms·
Any PRNG will return the same sequence when starting with the same seed. That's basically the point of it and it's quite a useful and important property, e.g. f
by ygra 3y ago
Any PRNG will return the same sequence when starting with the same seed. That's basically the point of it and it's quite a useful and important property, e.g. for simulations where you then just have to document your chosen PRNG and the seed for others to replicate your results instead of also shipping gibibytes of random numbers.
And since the exact algorithm has been documented for java.util.Random you can't just change it.
That being said, .NET had a similar problem, with System.Random having some drawbacks and bugs over the years. They chose to keep the algorithm the same when a seed is used (again, it's an important property you don't just break), but otherwise switch to something completely different. It gets more complicated even, as you can derive from Random there and some of those changes may be observable, so they also check for that: https://source.dot.net/#System.Private.CoreLib/src/libraries/System.Private.CoreLib/src/System/Random.cs,bb77e610694e64ca https://source.dot.net/#System.Private.CoreLib/src/libraries...