Question 4 (50%).
Assume that a source of U(0, 1) random numbers U1, U2, . . . is readily available. Consider the following probability density function of the continuous random variable X:
f(x) = {
(1/12)(x + 2)^3, if -2 ⤠x < 0
(2/27)(3 - x)^2, if 0 ⤠x ⤠3
0, otherwise.
(a) A majorizing function of f(x) is given by:
t(x) = {
(1/3)(x + 2), if -2 ⤠x < 0
(2/9)(3 - x), if 0 ⤠x ⤠3
0, otherwise.
Using the majorizing function t(x), construct an algorithm for generating independent and identically distributed random variates for X by the acceptance-rejection method. Show all steps explicitly and clearly.
(b) Assume that the following uniform random numbers are available:
0.6, 0.9, 0.7, 0.3, 0.5, 0.1.
Generate the first X (correct to 3 significant figures) by your algorithm.