Bogazici University - Fundementals of Particle-Based Simulations CMPE 49G
This Python script simulates Buffon's Needle experiment using a Monte Carlo method.
To run the simulation, execute the script and provide the following arguments:
N
: Number of needles to drop.L
: Length of the needle.D
: Distance between the parallel lines on the floor.
Example usage:
python simulation.py 10000 5 10
The above command will simulate dropping 10,000 needles, each of length 5 units, onto a floor with lines spaced 10 units apart.