Optimal Algorithms for Generating Discrete Random Variables with Changing Distributions," Max Planck Institute