Homework 17, Due Friday Nov 20, 2009. ===================================== This exercise implements an example (Example 3, p. 172) covered in the paper, "Explaining the Gibbs Sampler", by Casella and George, American Statistician (1992) 46, 167-174. (a) Generate (and time) a direct simulation of 1000 iid nonnegative-integer valued random variables X_1, X_2, ..., X_{1000} from the marginal distribution constructed in the Homework Handout HW17Exmp.pdf. (Use the idea given at the bottom of p.1 to top of p.2 of the Handout. (b) Write code to generate a Gibbs Sampler simulation of variables X_1, X_2, ..., from a Markov Chain with equilibrium distribution the same as the marginal X distributon f(x) from HW17Exmp.pdf. Create some graphical exhibit (e.g. a histogram or appropriate Table) to show that you have simulated random variables X_i with the same (marginal) distribution in both parts (a), (b). (c) To do a fair comparison of the running time of direct and Gibbs-Sampler simulation of iid X's, you need to figure out how large the integers K and T should be so that the variables X_K, X_{K+T}, X_{K+2T}, ... X_{K+999T} are all approximately independent with the marginal probability mass function f(x).