Skip to content

A beautiful, interactive web application that simulates various probability problems using the Monte Carlo method. Visualize probability theory in action!

Notifications You must be signed in to change notification settings

MYounesDev/probability-simulator

Repository files navigation

🎲 Monte Carlo Probability Simulator 📊

A beautiful, interactive web application that simulates various probability problems using the Monte Carlo method. Visualize probability theory in action!

✨ Features

  • 🧮 Multiple Simulation Types:

    • 🎯 Custom Probability
    • 🪙 Coin Flip
    • 🎲 Dice Roll
    • 🏐 Ball Draw
    • 🎂 Birthday Paradox
    • 🃏 Card Drawing
    • 📈 Geometric Distribution
    • 📊 Binomial Distribution
    • 🚪 Monty Hall Problem
    • 📶 Poisson Distribution
  • 📊 Real-time Visualization: Watch as the simulated probability converges toward theoretical probability

  • ⏱️ Adjustable Speed: Control how fast simulations run

  • 📝 Detailed Statistics: Track success rate, total experiments, and more

  • 📉 Error Analysis: See how close your simulation is to theoretical probability

  • 🎨 Beautiful UI: Modern, responsive interface with animations

🖼️ Screenshots

Main Interface

Main Interface

Simulation in Action

Simulation Running

🛠️ Technologies Used

  • ⚛️ React
  • 📱 Next.js
  • 🎨 Tailwind CSS
  • 📊 Recharts
  • 🎭 Lucide React Icons

🚀 Getting Started

Prerequisites

  • Node.js 18.0 or higher
  • npm or yarn

Installation

  1. Clone the repository:

    git clone https://github.com/MYounesDev/probability-simulator.git
    cd probability-simulator
  2. Install dependencies:

    npm install
    # or
    yarn install
  3. Run the development server:

    npm run dev
    # or
    yarn dev
  4. Open your browser and navigate to http://localhost:3000

🎮 How to Use

  1. 🎯 Select a simulation type from the available options
  2. ⚙️ Adjust parameters specific to the simulation
  3. ▶️ Click "Start" to begin the simulation
  4. 📊 Watch the probability converge toward the theoretical value
  5. 🔄 Reset the simulation to try different parameters

📝 Theory Behind the Simulations

The Monte Carlo method involves running many random experiments and observing the frequency of specific outcomes. As the number of experiments increases, the observed probability converges to the theoretical probability according to the Law of Large Numbers.

👏 Acknowledgements

  • 📚 Built with Next.js
  • 🎨 Styled with Tailwind CSS
  • 📊 Visualized with Recharts
  • 🎭 Icons provided by Lucide React

Made with ❤️ by @MYounesDev

About

A beautiful, interactive web application that simulates various probability problems using the Monte Carlo method. Visualize probability theory in action!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published