Giter VIP home page Giter VIP logo

law-of-large-numbers's Introduction

Law-of-Large-Numbers

Exploring the law of large numbers in R with execution from Windows CMD (must be in administrator mode). This program will output 5 png files which show the barplots of 10,000 tests of rolling 1, 2, 6, 10, 100 dice and counting the number of times 3 is face-up.

To run the script

  1. Download and install R
  2. Open the directory for where R is installed, in my case it is "C:\Program Files\R\R-3.6.2\bin"
  3. Open an instance of CMD in administrator mode (we'll be writing png files)
  4. Type "Rscript ", eg "Rscript "C:\Users\Justin Cervantes\Desktop\Law-of-Large-Numbers\law_of_large_numbers.R"

Summary: With lower numbers of dice, we expect a right skew because 1 dice has a 1/6 chance of rolling, so the ratio we’d expect is 1-5 3’s to non-threes. As more dice are cast however, we see the skew change to be zero-skewness because over more dice, the range stabalizes and the odds of getting no 3s are less. If you rolled 100 dice, the odds of none of them landing as a 3 are very few, and conversely the odds of having 100/100 dice is also extremely unlikely. The outcome we'd expect with more dice is to have the same probability of one dice rolling a 3, or 1/6. This is observed with a neutral graph with most tests at about 16 (1/6 * 100 dice).

One Die Two Dice Six Dice Ten Dice One Hundred Dice

law-of-large-numbers's People

Contributors

justincervantes avatar

Watchers

James Cloos avatar  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.