Homework Problem 9, Due Friday February 22. -------------------------------------------- The objective in this problem is to simulate data from an unfamiliar but not too exotic univariate density, by two different methods, and compare the results. (a) Write a function to generate N random variates X_1, ..., X_N for the density f(x) = c log(1+x) x^2 e^{-x} , x > 0 where c = 0.3851565 is determined by the condition that f(x) integrates to 1 on (0,infty). In this part, use a method directly based on the probability integral transform, using a parallelizable evaluation (or highly accurate approximation) of the inverse distribution function F^(-1). (b) Write a function to do the same task as in part (a), using an Accept/Reject Method. (c) Test the two functions you have written, possibly against each other, using a formal chi-square goodness of fit test. Also test which method works faster. (The answer to this may well depend on how accurately you have chosen to approximate the df in (a).)