Library for generating discrete random variates from a set of dynamically weighted elements in Solidity.
Based on this paper.
The algorithm preprocesses a list of weighted elements into a forest of trees data structure, and then traverses that forest to generate a random variate from the discrete distribution in sublinear time. Critically, the library supports inserting, updating, and deleting elements from the forest.
more to come