

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Material Type: Assignment; Class: Simulation; Subject: Industrial & Systems Engr; University: Georgia Institute of Technology-Main Campus; Term: Summer 2009;
Typology: Assignments
1 / 3
This page cannot be seen from the preview
Don't miss anything!
Homework #2 Solutions
∫ (^1)
− 1
2 π
exp{−x^2 / 2 } dx.
(a) Use n = 100 Unif(0,1) random variates to produce your answer. Repeat this 50 times and make a histogram of the results. (b) Using the above 50 runs, estimate the variance of Iˆ 100. (c) Can you think of any way to calculate an “exact” answer?
By the way, if you need a uniform generator, here’s an easy FORTRAN function that a lot of people use: (Of course, if you don’t want to do any programming, you can use Excel; or you can just pick a whole bunch of uniforms out of your head — but this might get a little tedious!!)
K1 = IX/127773 (Note: this division truncates, e.g., 5/3 = 1.) IX = 16807(IX - K1127773) - K1*2836 (seed is updated for next use) IF(IX.LT.0)IX = IX + 2147483647 UNIF = IX * 4.656612875E- RETURN END
Solution. (a)
Iˆn = b^ −^ a n
∑^ n
i=
f (a + (b − a)Ui)
∑^100
i=
f (−1 + 2Ui)
(since a = −1, b = 1, and n = 100)
=
∑^100
i=
2 π
e−(−1+2Ui)
2 .
Now you do the rest (50 times). 2
(b) Just take the sample variance of your 50 replications from (a). 2
(c) The actual answer is
∫ (^1)
− 1
2 π
exp{−x^2 / 2 } dx
= 2Φ(1) − 1 (where Φ(·) is the standard normal c.d.f.) = 2(0.8413) = 0. 6826. 2
Hints: You may need to recall that the relevant circle is described by (x − 1 /2)^2 + (y − 1 /2)^2 ≤ 1 /4. Generate the ith dart by using [U 1 i, U 2 i], where the U ’s are i.i.d. Unif(0,1) random variables.
Solution. Lots of ways to do this problem. If you follow the hint, simply deter- mine the proportion of time that your darts fall inside the circle, say ˆpn. Then, as discussed in class, the estimator for π is ˆπn = 4ˆpn. You should be getting slow but pretty steady convergence to π as the sample size gets larger. 2
Solution. Your answer should converge to 43 πr^3 = π/6. 2