0

I read this question:How to generate a random number between 1 and 10 with a six-sided die?

And read in the comments that "since 6 is not divisible by all the factors of 10", there is no method that requires only some fixed number of steps to give a random digit.

But it is not clear to me why it is so.

For example why shouldn't the method presented in the second answer (by MJD) always end in a fixed number of steps?

(I think that even if it really doesn't end in a finite number of steps for a 6 sided die, there should be some number that is not divisible by all the factors of 10 (e.g. 7) for which it ends in a finite number of rolls in all cases.)

Could you tell me how it follows from 6 not being divisible by all the factors of 10 that there is no random digit generating method with a dice that ends in a finite number of steps.

  • 1
    Note that MJD's answer itself also says "We can't guarantee to bound the number of die rolls in advance (no method can, as explained in the comments)". – joriki Jul 19 '15 at 21:51

2 Answers2

1

If you throw a six-sided die $n > 0$ times, you get $6^n$ possible results. If you say that any one of $m$ results is considered to be, say, $1$, you get $1$ with probability $m/6^n$. But $m/6^n$ cannot equal $1/10$, no matter what $m$ and $n$ are, because $6^n$ cannot be a multiple of $10$.

fkraiem
  • 3,129
1

No power of $6$ is divisible by ten, hence no strategy works in a finite number of steps. However, many strategies requires just a few steps, in average. For instance, we may generate the representation in base $6$ of a number in $[0,1)$ and stop when it is clear that we cannot leave anymore an interval of the form $\left[\frac{n}{10},\frac{n+1}{10}\right]$ with $n\in\{0,1,2,3,4,5,6,7,8,9\}$. When that happens, we return $n+1$ as outcome. By the information point of view, that is the best possible approach. However, if we are extremely unlucky, we may need an arbitrarily large number of throws:

$$ 2,2,2,2,2,2,2,4\quad\longrightarrow\quad 0.11111113_6=0.20000107\quad \longrightarrow 3.$$

Jack D'Aurizio
  • 353,855