Skip to content

Python Basic MC

LonelyProf edited this page Sep 17, 2017 · 1 revision

Hit-and-miss and sample-mean

The two programs hit_and_miss.py and sample_mean.py illustrate two very simple Monte Carlo methods to estimate the volume of a 3D object. They are both described in detail at the start of Chapter 4. No user input is required. For the built-in values defining the geometry, the exact result is 5/3.