Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Open a new spreadsheet and enter: . x in cell A1 . . f(x) in cell B1 2. We want to generate a random

image text in transcribed
1. Open a new spreadsheet and enter: . x in cell A1 . . f(x) in cell B1 2. We want to generate a random number between 0 and 2 in cell A2 . Recall that RAND() outputs a random number between 0 and 1. So we just need to multiply RAND () with 2. Enter -2*RAND() into cell A2 . Recall that the random number updates if you input text into another cell and press enter. 3. Compute f(x) by entering =A2 2 in cell B2 . 4. Repeat this experiment 10 times. To do this, select cells 42-B2 and drag down the blue dot until you get to row 11 . 5. Enter average into cells A12 and B12 . 6. Compute the average of all numbers in row A by entering =AVERAGE(A2: A11) in cell A13 7. Compute the average of all numbers in row B by entering =AVERAGE(B2:B11) in cell B13. f(x) 1.957043256 3.830018306 0.638944648 0.4082502632 1.769320784 3.130496035 5 1.094795309 1.198576769 6 0.2430717542 0.05908387769 0.9270329532 0.8593900963 1.689844082 2.855573023 9 0.7138634392 0.5096010099 10 0.4251991401 0.1807943088 11 0.6429801592 0.4134234852 12 average average 1.010209552 1.344520717 12 Note that the average in cell A13 (i.e., the average over all values of a) is about 1, which is in line what we discussed. The average of all values in cell B13 (ie., the average over all values of f(x)) is about 1.33..., which is the average of the function. Of course, these numbers are the result of randomness. For example, you could be extremely unlucky and all values of a could be less than 1. In this case, all values of f(r), including their average would also be less than I, resulting in a bad approximation. But such an unfortunate event would only happen with a probability of ()10 2 0.1%. As you increase the number of sample points, the averages of all a and f(x) values become closer to 1 and 1.333..., respectively, and the probability for outliers goes to zero. By the way, you can always update the choice of the random number by inputing text into a free cell and pressing enter. ? Modify your spreadsheet to increase the number of samples (i.e., add more rows) to 100 or 1000. Check whether the averages become closer to 1 and 1.333. .., respec- tively. It can be shown that the Monte Carlo Method converges at a rate of about . This means that in order to gain one additional digit of precision (i.e, decrease the error by a factor of 10), you need o increase the number of samples by a factor of 100. This is not as good as the left/right endpoint approximation or the midpoint approximation, which converged at rates , and ma, respectively. However, the Monte Carlo Method has advantages in certain situations, for example: . The fact that the sample points are chosen randomly makes the Monte Carlo Method more robust to functions with periodic patterns. For example, suppose you want to compute the integral o f(x)dix of the function f(r) = cos(2520r). This integral equals 0, however the left endpoint approximations /1, L2, ..., 10 all return 27, because the sample points always happen to be located at the local maxima. By contrast, this is not an issue for the Monte Carlo Method, because its sample points do not form a periodic pattern. In addition, the precision of the left/right/midpoint approximation normally deteriorates the more "complicated" the function f is. The precision of the Monte Carlo approximation doesn't. . In many practical applications it is necessary to compute higher dimensional integrals. In other words, one needs to evaluate iterated integrals of the form If the dimension d is large, then the left/ right endpoint approximation converges very slowly, at a rate of 75. So for example, suppose that the dimension (i.e., the number of parameters) is 10, which is not that uncommon. In order to improve the precision of the approximation by one additional digit, you would need to increase the number of samples by a factor of 1010 - 10, 000. 000, 000, which is often impossible. For the Monte Carlo Method, you just need to increase the number of steps by a factor of 100, no matter how high the dimension is. 13 Exercise 3 The number is an important number in statistics (and many experimental sciences). It expresses the probability of a measurement falling within one standard deviation of the actual value, assuming a Gaussian error distribution. Approximate this integral using the Monte Carlo Method and using at least 100 sample points (i.e., rows). Remember that you have to adjust the formulas in columns A and B. Note that Google Spreadsheets incorrectly interprets -42-2 to mean "the square of -A2 ". So you need to set additional parentheses as follows to compute the negative of the square: -(A2 2) . Don't forget to multiply your result by the length of the interval, because the question is asking for the value of the integral and not for the average of the function! Report your approximation of the above integral to Gradescope and upload a screen- shot (select File, Download, PDF and Export to save your work as a PDF and upload this PDF). You may round to 2 digits after the decimal point. It may happen that your approximation is slightly off in which case we will look at your screenshot and assign points manually

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

WebAssign For College Algebra And Calculus An Applied Approach

Authors: Ron Larson

2nd Edition

133776843X, 9781337768436

More Books

Students also viewed these Mathematics questions

Question

6. What information processes operate in communication situations?

Answered: 1 week ago

Question

3. How can we use information and communication to generate trust?

Answered: 1 week ago