Generate pseudorandom numbers and sample probability distributions with optional seed and choice of algorithm.