Finish problems from Lab 7 before attempting these problems
Come up with at least two methods to draw samples from the following distribution and implement them in Python:
 = \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})
Use the box mueller transform to generate standard normal random variables. Use this as the envelope distribution to generate normal random variables with mean

and

.
Solution