Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Suppose we toss darts randomly at a square dartboard, as seen in the Figure, and whose sides are 1 foot in length. Suppose also that
Suppose we toss darts randomly at a square dartboard, as seen in the Figure, and whose sides are 1 foot in length. Suppose also that there's a quarter circle inscribed in the square dartboard. The radius of the circle is 1 foot, and its area is pi/4 square feet. If the points that are hit by the darts are uniformly distributed (and we always hit the square, then the number of darts that hit inside the circle should approximately satisfy the equation: number in circle/total number of tosses pi/4 almostequalto since the ratio of the area of the circle to the area of the square is pi/4. We can use this formula to estimate the value of pi with a random number generator using the given serial code: This is called a Monte Carlo method, since it uses randomness (the dart tosses). The algorithm that is shown on the top is different than the one that comes with the book. Please follow the serial code given to out and use our timer to measure the time, otherwise if you cannot get full credit. You can use any of the libraries that you know MPI, PTHREAD or OPENMP) Attach your code, and the snapshots of all the results. Try at different numbers of processors shown in the table for the given number of 100,000,000 tosses, and compare the results and find the most efficient processor number for your approach. Fill all cells at the table. Suppose we toss darts randomly at a square dartboard, as seen in the Figure, and whose sides are 1 foot in length. Suppose also that there's a quarter circle inscribed in the square dartboard. The radius of the circle is 1 foot, and its area is pi/4 square feet. If the points that are hit by the darts are uniformly distributed (and we always hit the square, then the number of darts that hit inside the circle should approximately satisfy the equation: number in circle/total number of tosses pi/4 almostequalto since the ratio of the area of the circle to the area of the square is pi/4. We can use this formula to estimate the value of pi with a random number generator using the given serial code: This is called a Monte Carlo method, since it uses randomness (the dart tosses). The algorithm that is shown on the top is different than the one that comes with the book. Please follow the serial code given to out and use our timer to measure the time, otherwise if you cannot get full credit. You can use any of the libraries that you know MPI, PTHREAD or OPENMP) Attach your code, and the snapshots of all the results. Try at different numbers of processors shown in the table for the given number of 100,000,000 tosses, and compare the results and find the most efficient processor number for your approach. Fill all cells at the table
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started