ISyE 6644 — Fall 2014

1
ISyE 6644 — Fall 2014
Homework #5 — due Tuesday, October 21 (revised 10/17/14)
1. Suppose the c.d.f. of X is F (x) = x4 /16, 0 ≤ x ≤ 2. Develop a generator for X.
Demonstrate with U = 0.54.
2. Suppose the p.d.f. of X is
f (x) =
1
(x − 2),
2
1
(2 − x3 )
2
if 2 ≤ x ≤ 3
.
if 3 ≤ x ≤ 6
Develop a generator for X. Generate 10 values of X, compute the sample mean,
and compare it to the true mean of the distribution.
3. Do a few of the following RV generation problems from Law, Chapter 8:
• 8.1(a): Give an algorithm for generating a generalized Cauchy RV with p.d.f.
(
f (x) =
"
πβ 1 +
x−γ
β
2 #)−1
,
x, γ ∈ R, β > 0.
• 8.1(c): Give an algorithm for generating a logistic RV with p.d.f.
f (x) =
(1/β) exp{−(x − γ)/β}
,
[1 + exp{−(x − γ)/β}]2
x, γ ∈ R, β > 0.
• 8.8: In each of the following cases, give an algorithm that uses exactly one
PRN to generate X.
(a) X = min(U1 , U2 ), where U1 and U2 are i.i.d. Unif(0,1).
(b) X = max(U1 , U2 ), where U1 and U2 are i.i.d. Unif(0,1).
(c) X = min(Y1 , Y2 ), where Y1 and Y2 are i.i.d. Exp(1/β).
• 8.11(a): Let’s generate RV’s with p.d.f. f (x) = 3x2 /2 for −1 ≤ x ≤ 1. Use the
following methods: inverse transform, composition, and acceptance-rejection.
Which is preferable?
2
• 8.12: Consider the polar method from the notes (and §8.3.6 of Law) for
generating standard normal RV’s. Show that the probability of acceptance of
W in Step 2 is π/4, and find the distribution of the number of rejections of W
before acceptance finally occurs. What is the expected number of executions
of Step 1?
• 8.13: Give a composition algorithm for generating from the Tria(0,m,1)
distribution (0 < m < 1). Compare it with the inverse transform method.
• 8.14: You’ll need the book for this one.
4. Demonstrate that you can generate Nor(0,1) random variates. Show me at least
five different methods. Provide histograms of your results.
5. Suppose X ∼ Pois(3). Generate 5000 values of X. Provide a histogram.
6. Let’s compare the run times of two Geom(p) generation techniques: (A) running
Bern(p) trials until you get a success, and (B) X = d`n(U )/`n(1 − p)e. To do so,
simply time how long it takes to generate 100 million RV’s using each method on
your computer. Make sure that you’re not running anything else on your computer
when you do the comparison runs.
7. Let’s compare the run times of two standardP
normal generation techniques: (A)
12
the desert-island CLT approximation Z =
i=1 Ui − 6, and (B) Box–Muller.
Again, you should time how long it takes to generate 100 million RV’s using each
method on your computer. Hints: Make sure that you’re not running anything else
on your computer when you do the comparison runs. And note that Box–Muller
gives you two Nor(0,1)’s at-a-time. Also, just to make sure that the methods
are giving you reasonable Nor(0,1)’s you may want to look at histograms of the
outputs or do some formal statistical test for normality.
8. Generate and plot 10000 bivariate normal random variates (X, Y ), where both
X and Y are standard normal but such that the correlation between X and Y is 0.9.