Random
It may or may not be a good thing when my preferred mode of procrastinating schoolwork (an ASP.net based web application due tomorrow night) is other schoolwork (a parallel program involving Monte Carlo simulation.)
I’ve heard criticism of “random” numbers on computers before, but it wasn’t until this year (in two or three different classes) that I finally wrapped my brain around why it’s actually impossible to have a truly random number on a contemporary computer (and therefore why most functions on these lines call themselves “PRNGs” or Pseudo-Random Number Generators.) In a nutshell, and grossly oversimplifying, the problem is that these PRNGs are built to produce streams of pseudo-random numbers—and those streams will eventually, ultimately, begin to repeat themselves. This has security implications: all kinds of interesting things become possible when you can guess the next random number.
But for me right now, the interesting problem is more prosaic: what if you’re running a program (like a Monte Carlo simulation) which depends on a lot of random numbers? More specifically, what if you’re running that program on some arbitrary number of computers greater than 1? The point of running the program in parallel, after all, is to check more random numbers in the same amount of time; if two machines are getting the same stream of pseudo-random numbers, one of them might as well not bother.
(There’s a ton of really cool stuff you can do with a cluster and a stream of really random numbers. Finding integrals in high dimensions, for example: try doing that with calculus. But I’m not there yet myself, and I digress. As usual.)
Enter SPRNG, a marvelous collection of big words: the Scalable Parallel Pseudo-Random Number Generator. I’ve just installed it in my account on our little learning cluster. This is much more fun than ASP.net.