Here's the first one.

1. Suppose X is a discrete random variable that takes on the three values x1, x2, x3 with probabilities p1, p2, p3 respectively. Describe how you could generate a random sample from X if all you had access to were a list of numbers generated at random from the interval [0, 1].

2. Suppose X is a continuous random variable with c.d.f. FX(x) = P(X <= x). To make things easier, suppose further that X takes on values in an interval [a, b] (do allow for a to be −1 and b to be +1).

Let Y be the random variable defined by Y = FX(X). This looks strange, but is perfectly

valid since FX is just a function, and you are allowed to take functions of random variables.

Your problem: show that Y distributed U[0, 1].

Method: calculate the c.d.f. Y , FY (y) = P(Y<=y ), for all real y. Replace Y with FX(X),

and consider when you can take the inverse of FX.

Taking the inverse of FX is not always possible, in particular, for x < a and x > b. Consider

those cases separately.

You will find that the c.d.f. of Y is 0 for y < 0, y for 0<y<1 and 1 for y > 1, so indeed

Y distributed U[0, 1].

An important application of this fact is that if u is a random selection from the interval [0, 1], F^(−1) X (u) is a random selection from X.

Alright..for no 1. I'm wondering how can the random variable have 3 values when the space we are taking the list of numbers only has 0 and 1?? I'm also not too clear on what they mean by generate a random sample??

For no 2. I've tried substituting in everything but I am not sure how to find the inverse of a probability. I've gotten F'(X) = p(x) - p(x min).

Also does anyone know how to program in R?