Fall 2011: STAT 598Z: Introduction to Computing for Statisticians

##### Random Variable Generation Continuation

Finish problems from Lab 7 before attempting these problems

1. Come up with at least two methods to draw samples from the following distribution and implement them in Python: $p(x) = \begin{cases} 1 + x & \text{ if } -1 \leq x \leq 0\\ 1 - x & \text{ if } 0 \leq x \leq 1\\ 0 & \text{ otherwise }.\end{cases}$
2. Use the box mueller transform to generate standard normal random variables. Use this as the envelope distribution to generate normal random variables with mean $\mu=0$ and $\sigma^2=0.5$.