Just for fun, I am trying to find a good method to generate a random number between 1 and 10 (uniformly) with an unbiased six-sided die.
I found a way, but it may requires a lot of steps before getting the number, so I was wondering if there are more efficient methods.
My method:
- Throw the die and call the result $n$. If 1ドル\leq n\leq 3$ your number will be between 1ドル$ and 5ドル$ and if 4ドル\leq n\leq 6$ your number will be between 6ドル$ and 10ドル$. Hence, we reduced to the problem of generating a random number between 1ドル$ and 5ドル$.
- Now, to get a number between 1ドル$ and 5ドル$, throw the die five times. If the $i$th throw got the largest result, take your number to be $i$. If there is no largest result, start again until there is.
The problem is that although the probability that there will eventually be a largest result is 1ドル$, it might take a willwhile before getting it.
Is there a more efficient way that requires only some fixed number of steps? Edit: Or if not possible, a method with a smaller expected number of rolls?
Just for fun, I am trying to find a good method to generate a random number between 1 and 10 (uniformly) with an unbiased six-sided die.
I found a way, but it may requires a lot of steps before getting the number, so I was wondering if there are more efficient methods.
My method:
- Throw the die and call the result $n$. If 1ドル\leq n\leq 3$ your number will be between 1ドル$ and 5ドル$ and if 4ドル\leq n\leq 6$ your number will be between 6ドル$ and 10ドル$. Hence, we reduced to the problem of generating a random number between 1ドル$ and 5ドル$.
- Now, to get a number between 1ドル$ and 5ドル$, throw the die five times. If the $i$th throw got the largest result, take your number to be $i$. If there is no largest result, start again until there is.
The problem is that although the probability that there will eventually be a largest result is 1ドル$, it might take a will before getting it.
Is there a more efficient way that requires only some fixed number of steps?
Just for fun, I am trying to find a good method to generate a random number between 1 and 10 (uniformly) with an unbiased six-sided die.
I found a way, but it may requires a lot of steps before getting the number, so I was wondering if there are more efficient methods.
My method:
- Throw the die and call the result $n$. If 1ドル\leq n\leq 3$ your number will be between 1ドル$ and 5ドル$ and if 4ドル\leq n\leq 6$ your number will be between 6ドル$ and 10ドル$. Hence, we reduced to the problem of generating a random number between 1ドル$ and 5ドル$.
- Now, to get a number between 1ドル$ and 5ドル$, throw the die five times. If the $i$th throw got the largest result, take your number to be $i$. If there is no largest result, start again until there is.
The problem is that although the probability that there will eventually be a largest result is 1ドル$, it might take a while before getting it.
Is there a more efficient way that requires only some fixed number of steps? Edit: Or if not possible, a method with a smaller expected number of rolls?
Just for fun, I am trying to find a good method to generate a random number between 1 and 10 (uniformly) with an unbiased six-sided die.
I found a way, but it may requires a lot of steps before getting the number, so I was wondering if there are more efficient methods.
My method:
- Throw the die and call the result $n$. If 1ドル\leq n\leq 3$ your number will be between 1ドル$ and 5ドル$ and if 4ドル\leq n\leq 6$ your number will be between 6ドル$ and 10ドル$. Hence, we reduced to the problem of generating a random number between 1ドル$ and 5ドル$.
- Now, to get a number between 1ドル$ and 5ドル$, throw the die five times. If the $i$th throw got the largest result, take your number to be $i$. If there is no largest result, start again until there is.
The problem is that although the probability that there will eventually be a largest result is 1ドル$, it might take a will before getting it.
Is there a more efficient way that requires only some fixed number of steps?
Just for fun, I am trying to find a good method to generate a random number between 1 and 10 with an unbiased six-sided die.
I found a way, but it may requires a lot of steps before getting the number, so I was wondering if there are more efficient methods.
My method:
- Throw the die and call the result $n$. If 1ドル\leq n\leq 3$ your number will be between 1ドル$ and 5ドル$ and if 4ドル\leq n\leq 6$ your number will be between 6ドル$ and 10ドル$. Hence, we reduced to the problem of generating a random number between 1ドル$ and 5ドル$.
- Now, to get a number between 1ドル$ and 5ドル$, throw the die five times. If the $i$th throw got the largest result, take your number to be $i$. If there is no largest result, start again until there is.
The problem is that although the probability that there will eventually be a largest result is 1ドル$, it might take a will before getting it.
Is there a more efficient way that requires only some fixed number of steps?
Just for fun, I am trying to find a good method to generate a random number between 1 and 10 (uniformly) with an unbiased six-sided die.
I found a way, but it may requires a lot of steps before getting the number, so I was wondering if there are more efficient methods.
My method:
- Throw the die and call the result $n$. If 1ドル\leq n\leq 3$ your number will be between 1ドル$ and 5ドル$ and if 4ドル\leq n\leq 6$ your number will be between 6ドル$ and 10ドル$. Hence, we reduced to the problem of generating a random number between 1ドル$ and 5ドル$.
- Now, to get a number between 1ドル$ and 5ドル$, throw the die five times. If the $i$th throw got the largest result, take your number to be $i$. If there is no largest result, start again until there is.
The problem is that although the probability that there will eventually be a largest result is 1ドル$, it might take a will before getting it.
Is there a more efficient way that requires only some fixed number of steps?
How to generate a random number between 1 and 10 with a six-sided die?
Just for fun, I am trying to find a good method to generate a random number between 1 and 10 with an unbiased six-sided die.
I found a way, but it may requires a lot of steps before getting the number, so I was wondering if there are more efficient methods.
My method:
- Throw the die and call the result $n$. If 1ドル\leq n\leq 3$ your number will be between 1ドル$ and 5ドル$ and if 4ドル\leq n\leq 6$ your number will be between 6ドル$ and 10ドル$. Hence, we reduced to the problem of generating a random number between 1ドル$ and 5ドル$.
- Now, to get a number between 1ドル$ and 5ドル$, throw the die five times. If the $i$th throw got the largest result, take your number to be $i$. If there is no largest result, start again until there is.
The problem is that although the probability that there will eventually be a largest result is 1ドル$, it might take a will before getting it.
Is there a more efficient way that requires only some fixed number of steps?