FR
frekkoz3/Dice-Probability-Visualizer
Tool to visualize dices probability distribution
๐ฒ Dice Distribution Visualizer
An interactive Python GUI application to simulate dice rolls and visualize probability distributions, comparing empirical results with the exact theoretical distribution.
The project is designed to be:
- simple
- modular
- extensible (2D now, 3D later)
โจ Features
- ๐ฒ Define arbitrary dice sets (e.g. 2D6, 3D4 1D20)
- ๐ Roll dice interactively or run large Monte Carlo simulations
- ๐ Live histogram of simulated sums
- ๐ Exact theoretical distribution overlay (via convolution)
๐ธ What you see
- Bars: empirical distribution from simulations
- Line: exact probability distribution
- As simulations increase, the bars converge to the line (law of large numbers)
๐ง Architecture Overview
DICE PROBABILITY VISUALIZER/
โ
โโโ source/
โโโ dice_set.py # Dice and DiceSet logic
โโโ viz.py # PyQt6 GUI
โโโ main.py # Main file to run the application
โโโ README.mdCore concepts
-
Dice: single die (e.g. D6, D20)
-
DiceSet: collection of dice with:
- rolling
- simulation
- exact distribution computation
๐ Installation
Requirements:
- Python โฅ 3.9
pip install numpy pyqt6 pyqtgraphโถ๏ธ Running the app
py main.py