An open API service indexing awesome lists of open source software.

https://github.com/gnlow/dscrtz

Generate random value from discrete distribution
https://github.com/gnlow/dscrtz

discrete-distributions random

Last synced: 6 months ago
JSON representation

Generate random value from discrete distribution

Awesome Lists containing this project

README

          

# Dscrtz
Generate random value from discrete distribution
## Example (Deno)
```ts
import {Discrete} from "https://raw.githubusercontent.com/gnlow/dscrtz/master/mod.ts"
const distribution = new Discrete(["A", 11], ["B", 20], ["C", 15])

console.log(distribution.rand(Math.random()))
```