README
Dscrtz
Generate random value from discrete distribution
Install
npm i dscrtz
Use
const Discrete = require("dscrtz")
const distribution = new Discrete(["A", 11], ["B", 20], ["C", 15])
distribution.rand(Math.random())
Generate random value from discrete distribution
<script type="module">
import dscrtz from 'https://cdn.skypack.dev/dscrtz';
</script>
Generate random value from discrete distribution
npm i dscrtz
const Discrete = require("dscrtz")
const distribution = new Discrete(["A", 11], ["B", 20], ["C", 15])
distribution.rand(Math.random())