I would like to investigate the following question and I am not sure if similar ideas have been investigated. I cannot really find a detail discussion about this matter on the Internet. It will be great if you can tell me what domain I should look into, or you may also give your view on the following questions.
Suppose we have one fair dice. We would like to choose an option randomly from 6 possible options. We roll the dice once then we can decide which option we should choose.
Suppose we now have 8 options. To choose an option randomly, different algorithms can be used. For example, roll the dice once first.
If the result is odd, we focus on option 1 to 4. Then roll the dice again, if we get 1 to 4, we know which option to use. If it is a 5 or 6, repeat the second step again.
If the result is even, we focus on option 5 to 8. Then roll the dice again, if we get $n$, which $1\leq n\leq 4$, we choose option $n+4$. If it is a 5 or 6, repeat the second step again.
One can check the the probability of choosing each option is exactly $\frac{1}{8}$.
My question now is to investigate if it is possible that for whatever number of options we have, we can always use a dice to choose an option randomly. And is there a general algorithm to follow in order to choose an option?
My second question is more advance. Suppose we have a fair $m$-faced dice and we have $n$ total options. Can we choose an option randomly by using the dice for any $m$ and $n$?
Once again, you don't have to answer the above two questions. I am looking for hints or domain that I should look into. Thank you.
Given an $m$-faced die, you can simulate an $n$-faced die, for any values of $m,n>1$.
Suppose the faces of your $m$-die are $0,1,\dots,m-1$. Then write out $0,1,\dots,n-1$ in base $m$. So each face of your $n$-die is associated with a base-$m$ string of length $\ell=\lceil\log_m(n)\rceil$.
Then roll your $m$-die a total of $\ell$ times consecutively, and record each die roll. This gives you a base-$m$ number with $\ell$ digits. If this matches up with one of $0,1,\dots,n-1$, great. If not, repeat the process again.
It's clear that each of the values $0,\dots,n-1$ are equally likely to show up. Furthermore, you will almost surely require a finite number of rolls. In fact, in expectation you will need $m^\ell/n<m$ rounds.
As a concrete example, let's take $m=2$ and $n=7$. Roll our $2$-sided die thrice, the list of outcomes is $$000,001,010,011,100,101,110,111.$$The first $7$ of these correspond to the faces $0,\dots,6$ of the $7$-sided die. If we roll three $1$s, then we simply ignore the result and go again.