dice-rolls-probability
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Dice Rolls Probability

Dice Rolls Probability is a javascript library for calculationg most likely results of a dice rolls

Installation

npm i dice-rolls-probability

Usage

Just import like any other librarym e.g.

const diceRollsProbability = require('dice-rolls-probability');
 
diceRollsProbability.averageDiceRollExact(6, 9)
diceRollsProbability.averageDiceRollApproximation(6, 9)

Functions

averageDiceRollExact: function takes as parameters how many sides the die has and how many dice you wish to throw. Then it calculates mean, variance and standardDeviation using all possible results of a roll. Recommended to use on smaller number of dice for higher accurancy.

averageDiceRollApproximation: function takes as parameters how many sides the die has, how many dice you wish to throw and how many rolls to make (default 100 000). Then it calculates mean, variance and standardDeviation using speciefied number of random samples. Recommended to use on a higher number of dice for faster calculations.

Package Sidebar

Install

npm i dice-rolls-probability

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

9.51 kB

Total Files

12

Last publish

Collaborators

  • dev_kac