Random Number Generation
Have you ever used rand() or Math.Random() or System.Random or java.util.Random? You could do a lot better. Did you know that these use one of the slowest and least random algorithms available?
I’m always appalled when a new language comes on the scene (like Java or C#) and it provides nothing better than a linear congruential random number generator. Or when applications that need good random numbers (like games) use this same generator. Should we all go back to using punch cards and Fortran, too?
Like most software algorithms, random number generation continues to be researched and improved on. Thanks to the internet, it doesn’t take much work to find out about these innovations and stay current with the state-of-the-art.
There are as many different random number generators as there are ways to search a string for a substring. However, two of my favorites are the Mersenne Twister and R250/521. These two random number generators take up very little space, have very long periods and other useful statistical properties, and are extremely fast — much, much faster than the standard random number generator that comes with your platform.

