in reply to random question

As an exercise for learning this is great. Please read http://www.random.org/randomness/, http://en.wikipedia.org/wiki/Pseudorandom_number_generator and read the sources sited from those, along with other scholarly articles describing how and why it is difficult to generate good pseudo random numbers, as well as to get ideas of how the algorithms in use work, and why they are considered to be "good".

-Scott