monty-hall

1.4.0 • Public • Published

Monty Hall JS Build Status Coverage Status Dependency Status devDependency Status

A Monty Hall problem simulator.

Install

npm install monty-hall

Example

var MontyHall = require('monty-hall');
 
var m = new MontyHall(10000);
 
console.log(m.results);
 
{
  switches         : 5006,
  switchWins       : 3304,
  stays            : 4994,
  stayWins         : 1687,
  switchWinPercent : 66,
  stayWinPercent   : 34
}

Package Sidebar

Install

npm i monty-hall

Weekly Downloads

8

Version

1.4.0

License

MIT

Last publish

Collaborators

  • edjboston