Skip to content

A simple python program to visually compare simulated vs mathematical probability using random fair dice rolls.

Notifications You must be signed in to change notification settings

DhivKrish7/dice-roll-probability

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

dice-roll-probability

A simple python program (similar to coin-toss-probability, this time with 6 variables) to visually compare simulated vs mathematical probability using random fair dice rolls. It can simulates any number of dice rolls and checks how close the experimental results get to the ideal 0.1667 mathematical probability for each number by using matplotlib graphing.

How-to-use

  1. Clone the repository
  2. Run the 'drpv.py' file
  3. Enter the number of dice rolls you want to simulate (better go above 100)
  4. It gives you a clean graph to see how simulated probability converges to 0.1667

Libraries-used

  1. Random
  2. Matplotlib

Useful-links

  1. https://en.wikipedia.org/wiki/Law_of_large_numbers

Thankyou!

https://www.linkedin.com/in/dhivkrish7/

About

A simple python program to visually compare simulated vs mathematical probability using random fair dice rolls.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages