Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with the part about making a figure in excel please!! You have been hired by the secretive - society to analyze a

I need help with the part about making a figure in excel please!!
You have been hired by the secretive -society to analyze a new strategy for calculating the value of through the development of a Python program. Here is the basic format of the strategy provided to you by the -society. Begin by recognizing that the area of a unit square (height =1.0, width =1.0) is 1.0 and the area of a quarter circle, which lies entirely within the unit square is r24=4. Now imagine that we choose a random point (x,y) within the unit square. The probability of that random point being within the quarter unit circle is 4~~79% because 79% of the area of the unit square is covered by the quarter unit circle! Now, if we choose 'many' random points, we can estimate the value of because 4x(fraction inside the circle)=.
Here's an outline of the algorithm that needs to be developed.
Specify the number of random points, n
Set a counter variable to zero. We'll use this variable to track the number of random points inside the circle
Start an iteration or loop that repeats n-times. For each iteration:
a. Generate two random numbers (i.e., a random point) using, for example, x,y= numpy.random.rand(2)
b. Using an 'if' statement, check if the random point is inside a unit circle (i.e.,x2+y21.0). If the point is inside the circle, add one to a counter variable
Calculate the estimate of by multiplying the fraction of points inside the circle by 4.0.
You should write a memo to the -society that summarizes your analysis of the feasibility of this algorithm. The report should include a figure, which may be generated using Excel or using matplotlib, that shows the accuracy of the proposed strategy on the y-axis (accuracy is the difference between the estimate of from the algorithm and the 'true' value) versus the number of random points used on the x-axis. The Python program should gain accuracy with more points. The head of the -society casually mentioned that you should try, "maybe 100, or 1000, or 10,000 random points" to see how the number of points impacts the accuracy. You have also been reminded to include your Python code in the appendix of the memo/report.
image text in transcribed

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

Learning MySQL Get A Handle On Your Data

Authors: Seyed M M Tahaghoghi

1st Edition

0596529465, 9780596529468

Students also viewed these Databases questions

Question

Compute the derivative f(x)=1/ax+bx

Answered: 1 week ago

Question

What is job enlargement ?

Answered: 1 week ago

Question

what is the most common cause of preterm birth in twin pregnancies?

Answered: 1 week ago