1
$\begingroup$

Could someone help explain how to solve the following problem:

enter image description here

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.

$\endgroup$
  • $\begingroup$ it means that if you have a random number generator which outputs samples from a uniform distribution on $[0,1]$, how do you use that to create another generator which only outputs a $3$ or a $4$ or a $5$ with the probabilities given in the table. $\endgroup$ – David Holden Oct 6 '14 at 1:30
  • $\begingroup$ Hint: $0.4+0.15+0.45 = 1$ $\endgroup$ – Graham Kemp Oct 6 '14 at 1:53
  • $\begingroup$ Another hint: Suppose $u \le 0.4$ What value would you assign to $X$? $\endgroup$ – soakley Oct 11 '14 at 14:56
1
$\begingroup$

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$
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.