GitHunt
DH

DhivKrish7/coin-toss-probability

A simple python program to visually compare simulated vs mathematical probability using random coin tosses.

coin-toss-probability

Just a simple python project to visually compare simulated vs mathematical probability using random coin tosses. It can simulates any number of coin tosses and checks how close the experimental results get to the ideal 0.5 mathematical probability for heads or tails by using matplotlib graphing.

How-to-use

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

Libraries-used

  1. Random
  2. Matplotlib
  1. https://en.wikipedia.org/wiki/Law_of_large_numbers

Thankyou!

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

Languages

Python100.0%

Contributors

Created October 18, 2025
Updated October 24, 2025
DhivKrish7/coin-toss-probability | GitHunt