Mental wrote:why would you want reproducible behavior if you need a random number? that's sort of a contradiction in terms isn't it?
If you don't know how they're used, then I can see how it would appear so. Most of my experience with random number generators is from simulations. The simulations we wrote were discrete event simulations; we used some know distribution to model some phenomenon, say, the arrival time of people to a lunch line. Getting a number from some known distribution requires generating a "random" number and applying the appropriate function to that number.
Now, let's say you're running your simulation, and some wierd behavior comes up - you will want to investigate this behavior further. And doing that requires being able to reproduce that behavior. If you're using truly random numbers, then you won't be able reproduce it, but if you're using pseudo-random numbers from a known number generator, you can.
All pseudo-random number generators will eventually cycle around and start repeating, but if the numbers used are large enough (like in the snippet of code I put up), it won't matter. The amount of numbers you'll go through before repeating is on the order of 2^32. Even simple algorithms like that one produce number streams that are, in most cases, indistinguisable from true random numbers.
There are, of course, areas in which you might want true random numbers, such as cryptography, but even then, I wouldn't be surprised if they're using pseudo-random numbers instead. On a computer, getting a truly random number requires interacting with some hardware - the Linux kernel uses the keyboard somehow - which is much, much slower than the above function.