Standard Uniform Distibution with Random Variable Could someone help explain how to solve the following problem:

From my understanding, this problem states that we have a function, Uniform(0, 1), that will generate a random value from 0 to 1 with uniform distribution. What I don't understand is how this translates into the random variable X or the given probability mass function.

One approach is to consider the cumulative distribution function $F(x)=P(X \le x)$
So taking a cumulative sum of the probabilities in your table, it might look like
x         3     4     5  
P(X=x)   0.40  0.15  0.45
P(X<=x)  0.40  0.55  1.00

Then look at your standard uniform random variable $U$ and 


*

*if $0 \le U \le 0.4$ then set $X=3$ 

*if $0.4 \lt U \le 0.55$ then set $X=4$ 

*if $0.55 \lt U \le 1$ then set $X=5$ 

