Description
Assignment 8
Total: 20 Points
General Instruction
• Submit uncompressed file(s) in the Dropbox folder via BeachBoard (Not email).
1. Implement a program to estimate π using simulation method.
(a) The program should generate n random points of (x,y) where 0 ≤ x < 1 and 0 ≤ y < 1 for n ∈{103,104,105,106}.
(b) You can use math.pi to compute error rates.
(d) (10 points) For n = 104, draw a scatter plot as Figure 1, i.e., blue color for dots whose distances from the origin (0,0) are less than 1, otherwise red color.
(e) Submit pi.ipynb.
Figure 1: Estimating π using simulation




Reviews
There are no reviews yet.