Showing posts with label notation. Show all posts
Showing posts with label notation. Show all posts

Tuesday, 15 May 2012

Simulating a dX

I've been thinking for a few months about how to best simulate rolling a dX, which is the same as indexing X entries randomly. It takes time to sort ideas and thoughts out; this is a starting point for collecting things together.

There are six standard polyhedral dice: d4, d6, d8, d10, d12 and d20. When using these we assume that the dice are fair - each side is equally likely to come up. If we were to create or simulate a die with X sides it would be best if it were fair. We cannot simulate a d11 using 2d6 directly - we get a range of 11 possible values, but there are different probabilities for each value. The simulated die would not be fair.

We can simulate a few dice with the six standard polyhedral dice through either re-rolling on the high value, or by "halving the die". It is not too difficult to introduce simple notation to account for both of these actions.

d6/2 gives a d3. We let d6r stand for the situation where we reroll the 6. We only want values 1-5 so d6r results in a fair d5. However, d10/2 also gives d5, and without the reroll. From the standard polyhedral dice we can simulate the following dice easily:

d2 = d4/2, d6/3, etc.
d3 = d6/2, d12/4.
d5 = d10/2, d20/4.
d7 = d8r.
d9 = d10r.
d11 = d12r.
d19 = d20r.


We could also simulate a fair d9 by rolling two d3s; these act as indexing nine entries in a table. We could denote this with d3 x d3 or (d3)^2.

d3 x d3 1 2 3
1 1 2 3
2 4 5 6
3 7 8 9

These various actions - re-rolling, halving and dividing across tables - allow us to build up a greater number of simulated fair dice. I'll go into more detail in future posts, and see if I can start to make sense about how we might simulate a dX for any positive integer X.

Sunday, 25 March 2012

Different Dice

I've been thinking about notation. A quick Google shows me that there are lots of people out there who are interested in probability questions with dice - and by extension with RPGs. Or perhaps that flows the other way, they are interested in games, and then start to get interested in how probabilities come from dice mechanics.

In either case, there are people out there who are interested in these areas. It's not my interest largely (when it comes to maths and RPGs) but it is definitely a good place to start, and one that throws up interesting points. Dice have different contexts. Rolling 2d6 in Apocalypse World, when you want to know the sum, gives you a value from 2 to 12, and those 11 values are distributed unevenly. In this case, you don't really care what either of the dice actually gives. You care about the total.

Rolling two d6s when you care about the values of each dice gives you a different proposition. Picture having a red d6 and a blue d6. Rolling 2 on red and 5 on blue results in something different from 5 on red and 2 on blue. Rather than have 11 values given by the sum of the faces, we have 36 possibilities, each with the same probability of occuring.

For future posts then we can consider 2d6 in the normal way and, to be clear, two d6 for the situation when we care about each individual result on the two d6s. Or three d8s. 3d10 is different from three d10s. A numeral in front of a die size will indicate that we want to sum them, a number in words will indicate that we want to use each result from the dice.

All sound fine? It might be a basic sort of thing to write about, but this is the foundations: important in games (of all kinds) and maths. On foundations we can extend outwards, upwards and in as many ways as can be supported.