CMSI 186 - Problem Set #5
Randomized Estimation
Due Tuesday, April 14

  • Overview

  • Ground Rules
    1. Make RandomizedIntegrator.java, which integrates various functions that are "built in" to the program using randomized (also known as Monte Carlo) integration, as discussed in class. In all other respects, the program should operate like Riemann.java from problem set #4.

      Note that a major issue is how your program should determine the coordinates of the bounding rectangle. This, too, can be handled by randomized estitmation- by taking, say, ten thousand random samples of the function, then selecting (perhaps some small multiple of) the high and low values that are obtained.
    2. Your program should generate one million random points within the bounding rectangle.

    3. Make RandomizedAreaEstimator.java, a program that estimates the area of overlap of an arbitrary number of circles and triangles using randomized estimation; the program's arguments will describe the various shapes and their coordinates. For example,

                    java RandomizedAreaEstimator circle 2.0 2.0 1.0 triangle 1.0 1.0 2.5 3.0 2.0 -3.0 circle 2.5 1.0 3.0

      would generate one million random points to estimate the area of overlap of (a) a unit circle whose center is at (2.0,2.0), (b) a triangle whose vertices are (1.0,1.0), (2.5,3.0), (2.0,-3.0), and (c) another circle whose center is at (2.5,1.0) with a radius of 3.0.

    Revised: April 3, 2009