How to plot the Monte Carlo pi histogram?
问题 I am trying to plot a histogram distribution of pi from the Monte Carlo method but I am getting histograms that are either skewed to the left or right each time I run the simulation instead of a histogram that is approximately symmetric and peaks at around 3.14. The output histograms also have some gaps and I think I am approximating pi correctly. My code is below: [...(importing relevant modules)] N = 1000 #total number of random points circlex = [] circley = [] squarex = [] squarey = [] pis