Skip to content

Generate discrete random variates from a set of dynamically weighted elements in Solidity using a forest of trees data structure, based on a novel algorithm laid out in a paper found in the esoteric footnotes of Knuth. Runs in iterative log time for on-chain use cases.

License

Notifications You must be signed in to change notification settings

valorem-labs-inc/LibDDRV

Repository files navigation

LibDDRV

Github Actions

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

Getting Started

Contributing

Security

About

Generate discrete random variates from a set of dynamically weighted elements in Solidity using a forest of trees data structure, based on a novel algorithm laid out in a paper found in the esoteric footnotes of Knuth. Runs in iterative log time for on-chain use cases.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published