Question: Q1 [50 points]. Let us design a Monte Carlo method to estimate the area of the shadow region under the green function y=ex when x

 Q1 [50 points]. Let us design a Monte Carlo method to

Q1 [50 points]. Let us design a Monte Carlo method to estimate the area of the shadow region under the green function y=ex when x is from 0 to r. As shown in the following figure, r is a variable (r>0) for range. Please write a Python program named "A1Q1_MonteCarlo.py" to implement your designed Monte Carlo method. In the first line of your code, please write " n=10000 " to define n as the experiment number of random sampling. Finally, please print out the estimated area for different range variables with the following format: When r=1, estimated shadow area is xxx When r=2, estimated shadow area is xxx When r=9, estimated shadow area is xXX When r=10, estimated shadow area is xxx [Hint]: You may need to use a loop for different range variables r and generate random sampling points automatically based on different range variables r

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!