Simulating a Dn
Mushrooms
 

n-sided Dice

There are five Platonic solids which are used to make physical dice. If you need a D6, use a cube. If you need a D4, use a tetrahedron. And so on. But what if you want a D33? Or a D71? Or any other die?

Platonic Dice

How do you simulate any n-sided die using just D6s?

This page will show you a procedure to simulate any statistically fair Dn you want using just D6s.

Dn for n≤6

First of all, we will need some simple notation to keep things consistent. We will use a colon to denote "with the following values" and then we can define the Dn for n≤6 as follows,

D2 =D6 : {1, 1, 1, 2, 2, 2},
D3 =D6 : {1, 1, 2, 2, 3, 3},
D4 =D6 : {1, 2, 3, 4, reroll, reroll},
D5 =D6 : {1, 2, 3, 4, 5, reroll},
D6 =D6 : {1, 2, 3, 4, 5, 6}.

For example, to simulate a D3, we roll a D6 and interpret the ordered face values {1, 2, 3, 4, 5, 6} as {1, 1, 2, 2, 3, 3}.

Dn for n>6

The basic method for n>6 is to use factorisation to express the number n in terms of numbers less than 6, and then use combinations of the dice defined above.

For example, let's simulate a D12. The number 12 can be expressed as 3 x 4, so we can use D3s and D4s to express a D12. Using our notation,

D12 =D4 : {D3 : {1, 2, 3}, D3 : {4, 5, 6}, D3 : {7, 8, 9}, D3 : {10, 11, 12}},

which is identical to

D12 =D4 : {D3, D3 + 3, D3 + 6, D3 + 9}.

In other words, we first roll a D4 and then consult what to do next. So, if we get a 2 on the D4, then we roll a D3 and add +3 to it, which will translate to 4, 5, or 6 on the D12.

This gives us a statistically fair distribution of values. Note that just adding the values of dice together is not statistically fair.

So, the first thing to do is express n>6 in terms of numbers less than 6. In order to do this, we need to determine whether n is a prime number or not.

If n is composite (i.e. not a prime number), then we find two factors p>1 and q>1 such that pq=n. Then,

Dn =Dp : {Dq, Dq + q, Dq + 2q,..., Dq + (p - 1)q}.

For example, for n=24, we could choose either 4 x 6, 3 x 8, or 2 x 12. If we choose 4 and 6,

D24 =D6 : {D4, D4 + 4, D4 + 8, D4 + 12, D4 + 16, D4 + 20}.

If we choose 3 and 8, we will have to iterate the process because 8 is also greater than 6, so

D8 =D2 : {D4, D4 + 4}

and therefore

D24 =D3 : {D8, D8 + 8, D8 + 16}
=D3 : {D2 : {D4, D4 + 4}, D2 : {D4, D4 + 4} + 8, D2 : {D4, D4 + 4} + 16}
=D3 : {D2 : {D4, D4 + 4}, D2 : {D4 + 8, D4 + 12}, D2 : {D4 + 16, D4 + 20}}.

If n is prime, we simply add +1 to it, do the same as for a composite n, and then reroll the last slot.

For example, to simulate a D11, we could use the same D12 as we used earlier, but with the final slot rerolled, so

D12 =D4 : {D3, D3 + 3, D3 + 6, D3 + 9}

and therefore

D11 =D4 : {D3, D3 + 3, D3 + 6, D3 : {10, 11, reroll}}.

Worked Example

This example will exhaustively demonstrate how the D8 shown above represents a statistically fair 8-sided die. We have

D8 =D2 : {D4, D4 + 4}

and therefore,
the roll of a 1 on the D2 and a 1 on the D4 gives a result of 1;
the roll of a 1 on the D2 and a 2 on the D4 gives a result of 2;
the roll of a 1 on the D2 and a 3 on the D4 gives a result of 3;
the roll of a 1 on the D2 and a 4 on the D4 gives a result of 4;
the roll of a 2 on the D2 and a 1 on the D4 gives a result of 5;
the roll of a 2 on the D2 and a 2 on the D4 gives a result of 6;
the roll of a 2 on the D2 and a 3 on the D4 gives a result of 7;
the roll of a 2 on the D2 and a 4 on the D4 gives a result of 8.

We see that each number on the D8 appears precisely once, so each has the same chance of being rolled. Therefore, this D8 is statistically fair—it is identical to rolling an octahedral D8.

More Worked Examples

In case the method isn't clear, here are some more worked examples. It's a good idea to use coloured dice and have a clear ordering in mind to hasten the process, so let's read the white die first, then the red, then (if needed) the black.

(1) For example, n=9. We can use p=q=3, giving

D9 =D3 : {D3, D3 + 3, D3 + 6}.

Then,
the roll White Five Red Three gives a result of 8—because we got a 3 on the white D3, which means we use D3 + 6 on the red die;
the roll White One Red One gives a result of 1;
the roll White Three Red Six gives a result of 6;
the roll Red Four White Two gives a result of 2.

(2) For example, n=11. From above, we have

D11 =D4 : {D3, D3 + 3, D3 + 6, D3 : {10, 11, reroll}}.

Then,
the roll White Four Red Four gives a result of 11;
the roll Red Six White Six requires the white die to be rerolled because of the D4—the white die rerolls a White Three giving a result of 9;
the roll Red Four White One gives a result of 2;
the roll White Four Red Five triggers a full reroll—the reroll White Two Red Three gives a result of 5.

Note that the second roll only required one die to be rerolled, whereas the fourth roll required two dice to be rerolled. This is because, in the second roll, the white die triggered a reroll just on the D4 and it would be statistically unfair to reroll the red die as it had nothing to do with that D4. However, in the fourth roll, a combination of two dice caused a reroll, so both were rerolled.

(3) For example, n=33. We can use p=3 and q=11, giving

D33 =D3 : {D11, D11 + 11, D11 + 22}
=D3 : {D4 : {D3, D3 + 3, D3 + 6, D3 : {10, 11, reroll}},
           D4 : {D3 + 11, D3 + 14, D3 + 17, D3 : {21, 22, reroll}},
           D4 : {D3 + 22, D3 + 25, D3 + 28, D3 : {32, 33, reroll}}}.

Then,
the roll White Three Red One Black One gives a result of 12;
the roll Red Three White Two Black Five gives a result of 9;
the roll Black Two White Four Red Six requires the red die to be rerolled because of the D4—the red die rerolls a Red Four giving a result of 21;
the roll Black Six Red Two White Three gives a result of 17.

Using Other Dice

This page has focused on using D6s to simulate a Dn, but any dice can be used. The most important thing is to first define all the Dn with n less than or equal to the number of sides on the die being used, then the rest of the method works the same as for a D6.

For example, if we use a D10 then we define:

D2 =D10 : {1, 1, 1, 1, 1, 2, 2, 2, 2, 2},
D3 =D10 : {1, 1, 1, 2, 2, 2, 3, 3, 3, reroll},
D4 =D10 : {1, 1, 2, 2, 3, 3, 4, 4, reroll, reroll},
D5 =D10 : {1, 1, 2, 2, 3, 3, 4, 4, 5, 5},
D6 =D10 : {1, 2, 3, 4, 5, 6, reroll, reroll, reroll, reroll},
D7 =D10 : {1, 2, 3, 4, 5, 6, 7, reroll, reroll, reroll},
D8 =D10 : {1, 2, 3, 4, 5, 6, 7, 8, reroll, reroll},
D9 =D10 : {1, 2, 3, 4, 5, 6, 7, 8, 9, reroll},
D10 =D10 : {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}.

Then, to simulate a D12 using D10s, we can use the same representation of a D12 as before, namely

D12 =D4 : {D3, D3 + 3, D3 + 6, D3 + 9},

but using the D4 and D3 as defined for a D10.


The dice image at the top of the page is from Wikipedia.

 
 
 

Leave a Comment


(optional)

 
Warvault Webring
 
DisclaimerContact
The Zombie Squig, TheZombieSquig, Warhammer, Games Workshop, Roleplay, Dungeons and Dragons, D&D, Proxy, Proxying, Represent, Dice, Dn, D6, D10, D12, Algorithm