Generate six random numbers that come $1, 2, 3, 4, 5, 6$ with the given ${\tt PMF}$ according to a sequence $.1, .1, .2, .3, .2, .1$ using non-uniform

68 Views Asked by At

Problem. Generate six random numbers that come $1, 2, 3, 4, 5, 6$ with the given $\texttt{PMF}$ according to a sequence $0.1, 0.1, 0.2, 0.3, 0.2, 0.1$ using non-uniform random number generator.

For this distribution, if we use uniform random number generator, just choose $10\cdot f(x)$ on the interval $\left [ 0, 1 \right )\!.\!$ But I have no idea to choose which method I would use, and how to use that ? For example, if I choose Pareto's random variate generation, how is it non-uniformly distributed in OP ? I need your help. Thanks a real lot !

1

There are 1 best solutions below

1
On BEST ANSWER

Not quite sure what the problem is even after your question update. Note that the implied CDF of the desired distribution is $0.1,0.2,0.4,0.7,0.9,1.0$ for $F:\{1,2,3,4,5,6\} \to (0,1)$.

You take a uniform random number generator and use it to generate some $U \in (0,1)$. Then apply the following:

  • if $0 < U < F^{-1}(1) = 0.1$, then $X = 1$
  • if $F^{-1}(1) = 0.1 < U < F^{-1}(2) = 0.2$, then $X = 2$
  • if $F^{-1}(2) = 0.2 < U < F^{-1}(3) = 0.4$, then $X = 3$

$\ldots$

Can you finish this?


More generally, it is very much worth to note that if $X$ has a CDF $F$, then $F^{-1}(X) \sim \mathcal{U}(0,1)$...