Fall Quarter 1999
Electrical Engineering and Computer Science Department S-331, 277-7339 PurposeIn this assignment you will create a program that will estimate the value of . AssignmentFirst, consider the figure below: The figure represents one quarter of a unit circle (a circle with radius=1). The area under the curve is equal to /4 since the area of a unit circle is r2 = 12 = . Now, if we were to randomly plot a point in the square above, the probability that it would be under the curve is equal to the ratio of the area under the curve to the area of the square (/4). The figure below contains a number of random points plotted in the unit square. By taking the ratio of all of the dots that landed under the curve to the total number of dots plotted, we can estimate the value of . There are 4000 random points in the above figure. 3143 of them lie under the curve, so we estimate to be 3.143.
Programming consideration: It is always good in program design to consider potential modifications that may be required a some later date. Be sure to keep this in mind when designing your program. Lab report (due 4:30pm Tuesday, November 2, 1999)This lab report need not be self-contained. At a minimum, your report should include:
As with any report you submit, correct spelling and grammar are required. In addition, your report should be submitted electronically following the Electronic Submission Guidelines. (You may wish to consult the sample report before submitting your report.) Be sure to keep copies of all your files, in case something gets lost. It may be wise to keep a diskette backup as well. If you have any questions, consult the instructor. This page was created by Dr. Christopher C. Taylor copyright 1999. |