Simulate the results of rolling a die using Uniform[0, 1]

160 Views Asked by At

I saw this question in one of my textbooks:

Let U be a random variable having a uniform(0,1) distribution. Describe how to simulate the outcome of the roll of a die using U.

I know that the outcome of rolling a die follows discrete uniform distribution with 6 outcomes, and each outcome has a probability of 1/6. I'm not quite sure how to approach this question. The straightforward solution I thought about was adding 6 unif[0, 1] distributions together to obtain the result of rolling a die. Would that be reasonable? If not, could someone correct me? Thanks!

1

There are 1 best solutions below

1
On BEST ANSWER

The 6 different sides of the die are all equally likely with probability $\frac{1}{6}$. So if you are given another random variable, just partition its image set into six equally likely subsets.

In your case: If $X$ follows a uniform distribution on $[0,1]$, just define a function $F : [0,1]\rightarrow \{1,...,6\}$ via $$F(x) = 1, \text{ if } x \in\left[0,\frac{1}{6}\right],$$ $$\vdots$$ $$F(x) = 6, \text{if } x \in \left[\frac{5}{6},1\right],$$ and set $Y = F(X)$ as your new variable. This random variable will yield a number from $1$ to $6$ with probability of $\frac{1}{6}$ for each one, i.e. simulate the throw of a die.