Problem 1

Generate data from the random vector (X,Y) with joint density \(f(x,y)=\frac14(2+x+y),-1<x<y<1\) using two different methods.

Problem 2

Consider the random vector (X, Y, Z) with joint density proportional to \(g(x,y,z)=yxz+x+z^2, 0<x,z<1;y=0,1\). Write a routine that generates data from this rv. Do several checks to verify that your routine works. This should include both graphical and numerical checks. It should also include a check of the three-dimensional joint distribution, not just the marginals.