Outline for January 23
Reading
:
none
Due
: Homework 2, due on February 1 at 11:55pm
Calculating π using a Monte Carlo method
How you do it
random
module
Building program in modules, including testing routines
First step: computing co-ordinates of dart toss [
mc1.py
]
Second step: see if a point falls within the unit circle [
mc2.py
]
Third step: read in a positive integer, with error checking [
mc3.py
]
Fourth step: out it all together and print the results [
mc4.py
]
Fifth step: plot the points [
mc5.py
]
Sixth step: add the results to the plot [
mc6.py
]
Matt Bishop
Office: 2209 Watershed Science
Phone: +1 (530) 752-8060
Email:
mabishop@ucdavis.edu
You can also obtain a PDF version of this.
Version of January 23, 2019 at 10:11PM