Question: How are random numbers generated.? How do languages such as java etc generate random numbers, especially how it is done for GUIDs.? i found that algorithms like Pseudorandomnumber generator uses initial values. 

But i need to create a random number program, in which a number once occurred should never repeats even if the system is restarted etc. I thought that i need to store the values anywhere so that i can check if the number repeats or not, but it will be too complex when the list goes beyond limits.?

Answer: 
There are a lot of ways you could generate random numbers. It's usually done with a system/library call which uses a pseudo-number generator with a seed as you've already described.

But, there are other ways of getting random numbers which involve specialized hardware to get TRUE random numbers. I know of some [poker sites](http://www.ultimatebet.net/help/random) that use this kind of hardware. It's very interesting to read how they do it.
Specifically regarding Java:

* `java.util.Random` uses a [linear congruential generator](http://en.wikipedia.org/wiki/Linear_congruential_generator), which is [not very good](http://www.alife.co.uk/nonrandom/)
* `java.util.UUID#randomUUID()` uses `java.security.SecureRandom`, an interface for a variety of cryptographically secure RNGs - the default is based on SHA-1, I believe.
* [UUIDs/GUIDs](http://en.wikipedia.org/wiki/UUID) are not necessarily random
* It's easy to find implementations of RNGs on the net that are much better than `java.util.Random`, such as the [Mersenne Twister](http://en.wikipedia.org/wiki/Mersenne_twister) or [multiply-with-carry](http://en.wikipedia.org/wiki/Multiply-with-carry)