At this point, I wouldn't be surprised if it was just a randomized number generator rather than any rational algorithm.