S
👥 Group Project
Submarine Sonar Simulation
PythonRandommatplotlibProbability Theory
Overview
A probability simulation built around a submarine detection game. The player fires sonar shots at a grid, with each shot position determined by dice rolls. Two variants were implemented: single-shot per round and double-shot per round. The simulation runs thousands of iterations to generate experimental probability data, which is then compared against mathematically derived theoretical probability values. Results are visualized using matplotlib to show distribution curves and convergence behaviour.
My Contributions
- Designed game logic for both single-shot and double-shot variants
- Derived and implemented theoretical probability formulas based on grid dimensions
- Ran large-scale simulations (10,000+ iterations) to generate experimental probability data
- Built matplotlib charts comparing experimental vs theoretical distributions and convergence rates
- Wrote analysis section documenting the law of large numbers in the context of the simulation
Tech Breakdown
Python 3, random module for dice-roll simulation, matplotlib for probability distribution and convergence charts, probability theory (theoretical vs experimental probability), statistical sampling