How to replace 8-sided dice with other dice

We need to not only generate numbers between 1 and 8, but also to make sure they are uniformly distributed.

Your solution does not produce uniformly distributed results (at least according to MJD, in the comments).

However, this procedure does: you can roll a 4-sided die for a value between 1 and 4, and then toss a coin: if heads, add 4 to the result.

It is easy to see that each number from 1 to 8 is produced by exactly one outcome: for example, a result of 3 requires a roll of 3 and a toss of tails, while a result of 5 requires a roll of 1 and a toss of heads.


There are essentially three basic ways to generate a number from $\{1\dots k\}$ for $k\ne n$ with an $n$-sided die that preserves the uniform probability of all results:

  • Truncation: if $k\lt n$, you can simply ignore (reroll) results greater than $k$
  • Division: if $n=mk$ for some integer $m$, you can designate $m$ different results as giving a result $i$ for $1\le i\le k$ (i.e. to simulate a $3$-sided die with a $6$-sided die, you can designate $\{1,2\}\rightarrow 1$, $\{3,4\}\rightarrow 2$ and $\{5,6\}\rightarrow 3$)
  • Exponentiation: if $k=n^m$ for some integer $m$ you can roll the die $m$ times, interpreting the results as the digits of an $m$-digit integer in base $n$ (and interpreting a result of $n$ as $0$, and a string of all $0$'s as $k$) Example: percentile dice

Any combination of these can be used, thus for instance you could simulate an $8$-sided die with a $6\text{-sided}$ die by exponentiation by 2 (simulating a $36$-sided die) followed by division by 4 (simulating a $9$-sided die) followed by truncation to $8$. Since you have multiple dice to start with, more solutions are possible, but you only ever need one die. For instance you could simulate an $n\text{-sided}$ die for any $n$ with just a coin using exponentiation (generating binary strings with head $\rightarrow 1$ and tail $\rightarrow 0$) and truncation (rerolling results greater than $n$), and going the other way, you can simulate a coin with an $n$-sided die for any $n\ge 2$ by truncation to an even number (if $n$ is odd), followed by division to $2$.

If you have multiple die sizes, exponentiation can be generalized to multiplication (as is used in the accepted answer): if $k=mn$, and you have dice of sizes $m$ and $n$, you can roll the $n$-sided die (interpreting a result of $n$ as $0$) and add $n$ times the result of rolling the $m$-sided die (interpreting $m$ as $0$), and interpret $0$ as $k$. In the accepted answer $n=4$, $m=2$ and $k=8$, but an alternate solution would use $n=2$ and $m=4$ so you could (for instance) roll the $4$-sided die (interpreting $4$ as 0), multiply the result by $2$ then add $1$ if you flip heads, and interpret an overall result of $0$ (that is $[4,\text{tails}]$) as $8$. It's equivalent (and simpler) to multiply the $\text{d}4$ result by $2$ and subtract $1$ if you flip tails.


Roll the D10 and if you roll 9 or 10, re-roll it. It's easy to remember and easy to do. And it gives uniform results.

Tags:

Dice