Build a simulator that rolls dice and flips coins thousands of times and shows, in numbers and simple text charts, how averages settle down (the law of large numbers), how sums of dice become bell-shaped (the central limit theorem), and how often "unlikely" streaks really happen.
Project idea · ungraded
Dice and Coin Simulator
You will use
Milestones
Build the smallest working version first. Ticks are saved in this browser only.
Stretch goals
- Add loaded dice and use a chi-square test to see how many rolls it takes to detect them.
- Plot the running mean with matplotlib and show the ±2 standard error band shrinking like 1/√n.
- Turn it into a small command-line game where players bet on outcomes.
Data
No data is needed: everything is simulated with numpy.random.default_rng(seed), so every run with
the same seed gives the same results.
Run it yourself
pip install numpy scipy
python simulator.py --dice 3 --rolls 10000 --seed 1
Optional: pip install matplotlib for charts.