GitHunt
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.md

Core 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
frekkoz3/Dice-Probability-Visualizer | GitHunt