posted 15 years ago
Since a random-generator generates it's values, they aren't as randomly as sometimes thought.

Modern systems use mouse- or keyboard-input, to generate numbers more randomly.

In most circumstances we don't need real random numbers, but something which looks like random.

Often there is a sequence of numbers generated, and this sequence is repeating itself, but after a very, very long time. A good algorithm will generate every possible value in the scope and with the same frequence.

The last generated number might be the start-value, to generate the next number, which leads to the same sequence for the same startvalue, the seed.

This looks like a drawback, but you may use a value based on the time to generate the seed, leading to new sequences for every run.

The same sequence might be very useful, when you compare two different implementations of an algorithm, which shall lead to the same result, but handle a lot of values, you don't like to generate manually.

Practical advice: Generate only one random = new Random () - object, and call random.next (...) on this common Object, which leads to a sequence of values.