GithubHelp home page GithubHelp logo

ybda / randomprobability Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 14 KB

Demo of how you can generate random numbers based on a set of given probabilities for a range of numbers.

License: GNU General Public License v3.0

C# 100.00%

randomprobability's Introduction

RandomProbability

Demo of how you can generate random numbers based on a set of given probabilities for a range of numbers.

Print

Probabilites (key is number, value is number's probability)

{ 2, 0.005 },
{ 3, 0.4 },
{ 4, 0.5 },

Result (the first object shows how many numbers and the second object shows their percentage)

{
  "0": 1355,
  "1": 1331,
  "2": 485,
  "3": 39896,
  "4": 49978,
  "5": 1414,
  "6": 1384,
  "7": 1388,
  "8": 1385,
  "9": 1384
}
{
  "0": 0.01355,
  "1": 0.01331,
  "2": 0.00485,
  "3": 0.39896,
  "4": 0.49978,
  "5": 0.01414,
  "6": 0.01384,
  "7": 0.01388,
  "8": 0.01385,
  "9": 0.01384
}

randomprobability's People

Contributors

ybda avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.