Showing posts with label numbers. Show all posts
Showing posts with label numbers. 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.

Thursday, 29 March 2012

Dice and Tables

I have been thinking again about the problem of indexing up to 400 elements in some kind of random table. In a previous post I mentioned that this was all possible using various computer methods. The main motivation here is thinking about how to do this at the table with just a bag of dice, and for the method to be unbiased, so that every entry has the same chance of being selected by the dice as any other.

Ideally, we want to:
  1. use the standard polyhedral dice: d4, d6, d8, d10, d12, d20;
  2. minimise re-rolling dice as much as possible;
  3. not have any more dice involved than necessary.
All of this, mathematically, leads to thoughts of "best" algorithms, and "best" processes. In any mathematical investigation, we very rarely are able to jump from ideals and assumptions to the final answer. This time is no different, but there is hope I think that something can be done which is both easy to use and simple to understand (mathematically).

The first insight which was really helped is the idea that indexing X elements in tables is the same as rolling a dX, where X is any positive integer. Imagine that you take X square pieces of paper, write the numbers from 1 up to X on them, and paste them to a board. Throw a dart blindly at the board and you randomly select a number - which, for all intents and purposes is the same as rolling a dX.

Take the numbers down off a board now and try to arrange them into a table, or into a series of tables. Here comes the IF:
If we can arrange the X squares into a series of good* tables, then we can index X elements easily.
A consequence of all of this is that those good tables could just as easily contain the numbers from 1 to X written on them. So rolling a dX and rolling to get one of those X elements add up to the same thing, more or less (in maths terms, I think we could safely say that the two things were homomorphic).

And this was my big thought on the topic so far (well, one of them at least): it makes as much sense to see how we can simulate a dX using the standard polyhedral dice as it does to think about organising X elements into tables.

In future posts, simulating dX with the standard polyhedral dice! And how this ties in to random tables.

*in the sense of the three criteria from earlier in the post

Tuesday, 27 March 2012

Random and Biased

Following on from my post "Different Dice" a few days ago, I think there is another important distinction to be made between the ideas of random and biased.

For example, if we roll a fair d6 - i.e., one which is not weighted in favour of any particular result - then whatever it lands on we know that it the result is both random and unbiased, because the die is fair. If we roll 2d6, paying attention to the sum as the result of this event, then while the result itself is still random it is biased. Because of the different ways that you can make a total of 7 from rolling two d6 dice, a 7 is six times more likely than getting a result of 2 or of 12 (both of which have only one way of being achieved).

I'm interested in this kind of bias a lot at the moment; I was tinkering/hacking together a zombie game* based a little on Risus and a little on Apocalypse World. Apocalypse World works well with its main dice mechanic because it is so straight forward: for around 60% of the time on a general (unmodified) roll your action carries - or at least you get some success. For less than 20% of the time the dice give you exactly what you want. This seems like a neat way to do it: the outcome is random, and there is a slight overall bias towards success.

But in the messed up post-apocalypse, maybe those are the kind of odds you need.

*more on that setting/game another time!

Wednesday, 21 March 2012

Wicked Numbers

This week I played In A Wicked Age for the first time, and in doing so I GMed for the first time. I got my initial thoughts about the experience down on my tumblr account. TL;DR - I love the game, I loved my first time as a GM and can't wait for both again - possibly with me GMing In A Wicked Age.

One of the things that I think was really strong about the game was the use of Oracles for setting up the game. I'm really into creativity and creative thinking as a skills trainer, and so using random provocations is very familiar to me. Last night we seeded our game, and the characters who were in it, by taking inspiration from the Oracle for The Unquiet Past. The elements that we randomly took (using a deck of cards*) were:
  • The guardian of a tomb, a statue cast in silver with ruby eyes
  • The arrival of honored emissaries from a wealthy exotic land
  • The son of a great tyrant, born crippled and denied his inheritance
  • A new village built on the ruins of a forgotten people
From these, ideas for about a dozen characters or types of characters who might appear came really easily, and I think that we then had a lot of fun during the game taking these in all kinds of directions. At the start of the night I had no idea what might happen; at the start of the game I still had no idea where things might go. And that worked out really well.

There's something understated in some ways about the In A Wicked Age manual. I've not read hundreds of RPG manuals/sourcebooks, but those that I have generally have a couple of ideas for campaigns or stories. Some have clear and cool guidelines for setting up campaigns, scenes and settings. In A Wicked Age doesn't have any of those. It has something better. It has the Oracles.

It has millions and millions of stories in the manual. Millions and millions in a 37 page pdf.

How many millions? We'll get into that in the next post.

*playing cards from the Bellagio hotel in Las Vegas. That's how I roll!