As always, the exercises in this section are here to improve your knowledge and understanding of the material. Please attempt to complete 1-3 of these exercises on your own:
- What other constants like π could we use Monte Carlo methods to calculate? Think of an experiment to calculate another constant we use.
- Open the Chapter_3_1.py sample code and change the value of n, that is, the number of darts dropped. How does that affect the calculated value for π? Use higher or lower values for n.
- When we calculated π, we assumed a uniform distribution of darts. However, in the real world, the darts would likely be distributed in a normal or Gaussian manner. How would this affect the Monte Carlo experiment?
- Refer to sample Chapter_3_2.py and change the value of n. How does that affect plot generation? Are you able to fix it?
- Open Chapter_3_3.py and change the...