Write a routine that generates random variates from a distribution with density proportional to \[g(x)=\sqrt{(1+x)^3(1-x)^5}\] \(-1<x<1\). Use only runif in your routine. Show that your routine generates the correct data.
Write a routine that generates random variates from a distribution with density proportional to \[g(k)=\exp(-\sqrt{k})\] \(k=0, 1, ...\). Show that your routine generates the correct data.
Write a routine that generates random variates from a distribution with density \[f(x,y)=1.732\exp\left(-[2+\sin(2\pi x)] y\right)\] \(0<x<1\), \(y>0\). Use the simulated data to find FX(0.5), F(0.5, 1), E[X], Var[X], E[Y], Var[Y], Cor(X,Y), FX|Y=1(0.5|1) and E[X|Y=1].
BONUS: Draw the graph of fX|Y=0.1(x|0.1).