Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For each of the problems below state the purpose in your own words, specify input that is needed, expected output, and the step by step

For each of the problems below state the purpose in your own words, specify input that is needed, expected output, and the step by step process that will obtain the output from the input (the algorithm). Please do not write any C++ code, just a algorithm for step by step insturction. (Please include test data.)

image text in transcribed

Write a process that will use the Monte Carlo method to estimate PI as described below. The Monte Carlo method to estimate probability generates a large number of points then determines how many points meet a specific condition. Consider the figure below containing a square with a circle inside of it, both of which are centered on zero.

The area of the circle would be r2 where r is 1. The area of the square is s2 where s is 2 (-1 to 1). Therefore the ratio of the area of the circle to the area of the square would be /4. Now suppose we generate random points to fall uniformly in the area of the square (x varies from -1 to 1 and y varies from -1 to 1). We can state ratio of the number of points falling inside the circle to the total number of the points is equal to the ratio of the area of the circle to the area of the square.

/4 = (number of points in the circle)/(total number of points) Therefore can be defined by the equation

= 4 * (number of points in the circle)/(total number of points)

Generate a process that would generate random numbers between 1 and 1 for x and y positions of 10000 points and count how many points fall with the circle, then determine an estimated version of .

Thanks.

-1 -1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database Foundations Technology Fundamentals For IT Success

Authors: Bob Bryla

1st Edition

0782143725, 9780782143720

More Books

Students also viewed these Databases questions