How many times can I use randomGenerator.nextDouble() before I need to reseed?
java, random
Solution
The random number generator will produce a random double from two random int values. The internal seed has 48 bit, so the random sequence repeats after at most 2^48 int values, or 2^47 double values.
Problem
I'm using the `Random` class in Java as a pseudo-random number generator. I'm using the function nextDouble a lot of times (~10^5). How many times before I have to reseed to prevent from getting the same numbers? Is reseeding needed? ``` Random generator = new Random(); double[] numbers = new double[n]; for (int i = 0; i < n; i++) numbers[i] = generator.nextDouble(); ``` This is for an experiment, the numbers will be used as coordinates for points on a space, so I want the distribution to be as uniform as possible. Also how do I reseed? Where do I get the int seed from?