Math 309 Extra-Credit Project 4 Fall, 2019
The amount of extra-credit will depend on the overall quality of your work. You
must submit a formal Report to show your work. The Report must be typed
and if possible prepare the Report with RMarkdown and submit both the .Rmd
file and the .html files. It is essential that you include proper comments in
expect mathematical expressions, tables, plots, with proper explanations, interpretations,
and meaning summary of your work in the report. A work with
just plugging in numbers and plain numerical answers will get very little credit
or no extra credit at all. You must work independently and require to comply
with the university policy on academic integrity found in the Code of Student
Conduct found at
1. (a) Show how to use Monte Carlo techniques to approximate the following
sum.∑∞k=0
cos(cos(k))/k!
(b) Use R to implement the Monte Carlo approximation of the sum in
part (a); use at least 10,000 runs.
(c) Show how to use Monte Carlo techniques to approximate the following
integration.
∫ π0cos(x/2)sin(2x)dx
(d) Use R to implement the Monte Carlo approximation of the integration
in part (c); use at least 10,000 runs.
2. (a) Show how to use Monte Carlo techniques to approximate the following
double integration.
(b) Use R to implement the Monte Carlo approximation of the double
integration in part (a); use at least 10,000 runs.
3. Let f(x) = 4/(π(1 + x2)), 0 ≤ x ≤ 1. (a) Explain how can we use the
acceptance-rejection method to generate sample from this distribution.
(b) Use R to implement the proposed algorithm in (a).
(c) Obtain the relative-frequency histogram and overly the true pdf on it.
4. We want to use the acceptance-rejection method to generate continuous
random variable X from a distribution with probability density function
f(x) = (m+n+1)!m!n!
xn(1 − x)
m for 0 ≤ x ≤ 1, n ≥ 1, n ≥ 1 and are integers;
and f(x) is zero otherwise. Suppose we use the pdf of Uniform(0,1) as the
proposal pdf (i.e., g(x) = 1, for 0 ≤ x ≤ 1).
(a) Find an appropriate constant c > 1 (i.e., as small as possible) such
that f(x)/(cg(x)) < 1 for 0 ≤ x ≤ 1.
(b) For n = m = 2, carry out the simulation with at least 5,000 runs.
Find the theoretical values of E(X) and V ar(X) and then compare with
their simulated values.
(c) Obtain the relative-frequency histogram of the simulated values; then
overlay the theoretical pdf.
(d) Repeat (b) and (c) for m = 2 and n = 4.

• QQ：99515681
• 邮箱：99515681@qq.com
• 工作时间：8:00-23:00
• 微信：codinghelp