Outline for April 22, 2014

Reading: none
Due: Homework #2, May 2, 2014
  1. Program: Fibonacci numbers [fib.py]
  2. Calculating π using a Monte Carlo method
    1. How you do it
    2. random module
    3. Building program in modules, including testing routines
    4. First step: computing co-ordinates of dart toss [mc1.py]
    5. Second step: see if a point falls within the unit circle [mc2.py]
    6. Third step: read in a positive integer, with error checking [mc3.py]
    7. Fourth step: out it all together and print the results [mc4.py]
    8. Fifth step: plot the points [mc5.py]

You can also obtain a PDF version of this. Version of April 21, 2014 at 9:01AM