dscrtz

Generate random value from discrete distribution

Usage no npm install needed!

<script type="module">
  import dscrtz from 'https://cdn.skypack.dev/dscrtz';
</script>

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())