Dynamic generation of discrete random variates
SODA '93 Proceedings of the fourth annual ACM-SIAM Symposium on Discrete algorithms
Hi-index | 0.00 |
We present and analyze an efficient new algorithm for generating a random variate distributed according to a dynamically changing set of weights. The algorithm can generate the random variate and update a weight each in $O(log^* K)$ expected time. (For all feasible values of $K$, $log^* K$ is at most 5.) The $O(log^* K)$ expected update time is amortized; in the worst-case the expected update time is $O(2^(log^* K))$. The algorithm is simple, practical, and easy to implement.